0

Hi I tired to check null values of my data frame(house) which has 81 columns but house.isnull().sum() display only few columns data.

MSSubClass         0
MSZoning           0
LotFrontage      259
LotArea            0
Street             0
                ... 
MoSold             0
YrSold             0
SaleType           0
SaleCondition      0
SalePrice          0
Length: 80, dtype: int64

I tired to run for loop to get the all columns in one go but couldn't do that. Appreciate your help

null_check = house.columns
for ncheck in null_check:
    print(ncheck.isnull().sum())
lasan13
  • 19
  • 6
  • 1
    Look at [How do I expand the output display to see more columns of a Pandas DataFrame?](https://stackoverflow.com/questions/11707586/how-do-i-expand-the-output-display-to-see-more-columns-of-a-pandas-dataframe) – ThePyGuy Jun 15 '21 at 22:59
  • Not really .. sorry – lasan13 Jun 16 '21 at 06:38

2 Answers2

1

Try running this line before you get the output

pandas.set_option('display.max_rows', 500)

See this other article on this

Pandas: Setting no. of max rows

0

Use pandas.DataFrame.isna() and call sum on axis=0, if needed, use .to_frame() to create dataframe out of it.

df.isna().sum(axis=0)

Item         0
Currency     20
Year Rate    3
dtype: int64
ThePyGuy
  • 17,779
  • 5
  • 18
  • 45