I want to know that how much null values exist in every column of my data. As my data is too large I am saving the result in csv to get a clear picture. But the problem is in my csv, I am unable to see the column name. What should i do to to print the column name against the sum of null values in my CSV file?
aw= data.isnull().sum()
aw.to_csv (r'C:/Users/a.csv', index = False, header=True)
my CSV file looks like this 0 0 0 10 0 9
I want to see it like this
feature1 0 feature2 0 feature3 0 feature4 11 feature5 12 feature6 12
the resulting aw is not a DataFrame. To check type(aw) output pandas.core.series.Series
what you could try is
aw = pd.DataFrame(data.isnull().sum()).T
the output is
feature1 feature2 feature3
0 0 0 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With