Open allis103 opened 7 months ago
I think you can try these two alternatives:
for element, valor in i.items():
if valor !=0:
print(f"{element}, {valor}")
or:
print('Columns with missing values sorted in descending order:\n')
i = df.apply(lambda x: sum(x.eq(99999)), axis=0).sort_values(ascending=False)
i[i>0]
Hi,
I was trying to spice up the basic code for exercise 1 by printing only the columns which have a value different from 1 then the column with the highest value. However I am incurring in some problems. This is my code :
Do any of you know why
i
is a list and not a matrix (it has a single column) and so how it can be linked to the attribute names in order to only print those ?Thanks !