0

Question as above. I always use this line of code df.isna().sum() to count the number of NAN values in each columns. This works great for dataset with 10-15 columns but when I have 20,30+ columns some of the output don't show, which gives me a hard time to find which col has NAN values. Is there a way to list out every column and its number of NANs?

the output of this line of code:

Id 0 MSSubClass 0 MSZoning 0 LotFrontage 0 LotArea 0 .. MoSold 0 YrSold 0 SaleType 0 SaleCondition 0 SalePrice 0 Length: 77, dtype: int64

some of the column names are replaced with .., I would like to see every column.

PiCubed
  • 375
  • 2
  • 5
  • 11
  • Yes thank you so much, i searched around but didn't find this. – PiCubed Jun 09 '20 at 03:37
  • please post the code for your data frame or the file here posting the image won't help https://stackoverflow.com/questions/11707586/how-do-i-expand-the-output-display-to-see-more-columns-of-a-pandas-dataframe – Darkknight Jun 09 '20 at 03:37
  • I think my question was very straight forward. I have solved it. Thanks – PiCubed Jun 09 '20 at 03:41

1 Answers1

0

this will do the work...

df.isna().any()
Darkknight
  • 1,716
  • 10
  • 23