python - How would I plot a graph of the number of non-NaNs per column in pandas? -
i messed around pd.count, can't seem dataframe descending columns , counts in way can plotted.
for example:
a b c d 1 1 1 1 nan nan 1 1 nan nan nan 1
i want ordered counts of values minus nans:
a 1 b 1 c 2 d 3
and graphed line graph depicting counts. i've looked around , there doesn't seem clear cutting way. help appreciated.
ah, okay:
ser = df.count() ser.sort(ascending=false) ser.plot(ser.plot(kind='barh')
python matplotlib pandas
No comments:
Post a Comment