0

I am going to standardized a vector layer field in Python console in QGIS, for that I want to get mean value and stdev value of the field.

How do I find mean and stdev in using PyQGIS.

I tried this. It is not working

layer=iface.activeLayer()
idx=layer.fields().indexFromName("mean")
ave = layer.meanValue(idx)
print (ave)
stdDev = layer.stdDevValue(idx)
print (stdDev)
PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Chathu_T
  • 73
  • 7

0 Answers0