Hi,
Im currently working on an assignment and we got some template files which we have to use to data mine a csv file.
And we are struggling with the following:
we need to list all the different options that are filled in. But with our code it lists all the options, so also doubles.
we tried to fix this with the CLASSES but this doesn't work.
with kind regards,
oog70
ps. pandas are not allowed
Im currently working on an assignment and we got some template files which we have to use to data mine a csv file.
And we are struggling with the following:
we need to list all the different options that are filled in. But with our code it lists all the options, so also doubles.
we tried to fix this with the CLASSES but this doesn't work.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
csvdirectory = '' filename = 'AdventourData.csv' Dataset,featuretypes = ReadData(csvdirectory + filename) itemtargetclasses = [item[ 3 ] for item in Dataset] CLASSES = [] if itemtargetclasses not in CLASSES: CLASSES.append(itemtargetclasses) if featuretypes[ 3 ] = = 'Numerical' : print ( 'Minimum is:' , min (itemtargetclasses)) print ( 'Maximum is:' , max (itemtargetclasses)) print ( 'Median is:' , np.median(itemtargetclasses)) print ( 'Mean is:' , np.mean(itemtargetclasses)) else : print ( 'Classes are:' , CLASSES) |
oog70
ps. pandas are not allowed