diff options
author | Sonja Galovic <galovicsonja@gmail.com> | 2022-04-11 17:01:23 +0200 |
---|---|---|
committer | Sonja Galovic <galovicsonja@gmail.com> | 2022-04-11 17:01:23 +0200 |
commit | d0bf82c914fbd9658be8613f79355dd04aaace17 (patch) | |
tree | ea5a47b6b29c0948f076a7a20ee618902168138f /backend/microservice/api/newmlservice.py | |
parent | 545ce7b8d919579e710139d64cde05363cf446b0 (diff) | |
parent | faa833e62c22932ce5ed755a1b6ec97ffb39631b (diff) |
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into dev
Diffstat (limited to 'backend/microservice/api/newmlservice.py')
-rw-r--r-- | backend/microservice/api/newmlservice.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/backend/microservice/api/newmlservice.py b/backend/microservice/api/newmlservice.py index 77cc59d0..02ce2250 100644 --- a/backend/microservice/api/newmlservice.py +++ b/backend/microservice/api/newmlservice.py @@ -33,7 +33,14 @@ def returnColumnsInfo(dataset): for kolona in svekolone: if(kolona in kategorijskekolone): - uniquevalues=datafront[kolona].unique() + unique=datafront[kolona].value_counts() + uniquevalues=[] + uniquevaluescount=[] + for val, count in unique.iteritems(): + uniquevalues.append(val) + uniquevaluescount.append(count) + #print(uniquevalues) + #print(uniquevaluescount) mean=0 median=0 minimum=0 @@ -43,7 +50,8 @@ def returnColumnsInfo(dataset): allNullCols=allNullCols+1 frontreturn={'columnName':kolona, 'isNumber':False, - 'uniqueValues':uniquevalues.tolist(), + 'uniqueValues':uniquevalues, + 'uniqueValuesCount':uniquevaluescount, 'median':float(mean), 'mean':float(median), 'numNulls':int(nullCount), @@ -62,6 +70,7 @@ def returnColumnsInfo(dataset): frontreturn={'columnName':kolona, 'isNumber':1, 'uniqueValues':[], + 'uniqueValuesCount':[], 'mean':float(mean), 'median':float(median), 'numNulls':int(nullCount), |