Skip to content

Commit f5b84ca

Browse files
committed
[processing] fixed frequency algorithm
1 parent e536905 commit f5b84ca

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

python/plugins/processing/algs/qgis/scripts/Frequency_analysis.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
from processing.core.TableWriter import TableWriter
99
from collections import defaultdict
1010

11-
layer = processing.getObject(input)
11+
layer = processing.getObject(Input)
1212
inputFields = layer.pendingFields()
1313
fieldIdxs = []
14-
fields = fields.split(',')
14+
fields = Fields.split(',')
1515
for f in fields:
1616
idx = inputFields.indexFromName(f)
1717
if idx == -1:
1818
raise GeoAlgorithmExecutionException('Field not found:' + f)
1919
fieldIdxs.append(idx)
20-
writer = TableWriter(output, None, fields + ['FREQ'])
20+
writer = TableWriter(Output, None, fields + ['FREQ'])
2121

2222
counts = {}
2323
feats = processing.features(layer)
@@ -26,8 +26,7 @@
2626
for i, feat in enumerate(feats):
2727
progress.setPercentage(int(100 * i / nFeats))
2828
attrs = feat.attributes()
29-
clazz = tuple([attrs[idx] for idx in fieldIdxs])
30-
print clazz
29+
clazz = tuple([attrs[idx] for idx in fieldIdxs])
3130
counts[clazz] += 1
3231

3332
for c in counts:

0 commit comments

Comments
 (0)