0
$\begingroup$

I'm trying to display all the columns in my dataset that have NaN values:

print(train.isnull().sum())

The output that I get is this:

Id                0
MSSubClass        0
MSZoning          0
LotFrontage       0
LotArea           0
Street            0
Alley             0
LotShape          0
LandContour       0
Utilities         0
LotConfig         0
LandSlope         0
Neighborhood      0
Condition1        0
Condition2        0
BldgType          0
HouseStyle        0
OverallQual       0
OverallCond       0
YearBuilt         0
YearRemodAdd      0
RoofStyle         0
RoofMatl          0
Exterior1st       0
Exterior2nd       0
MasVnrType        8
MasVnrArea        0
ExterQual         0
ExterCond         0
Foundation        0
                 ..
BedroomAbvGr      0
KitchenAbvGr      0
KitchenQual       0
TotRmsAbvGrd      0
Functional        0
Fireplaces        0
FireplaceQu       0
GarageType        0
GarageYrBlt      81
GarageFinish      0
GarageCars        0
GarageArea        0
GarageQual        0
GarageCond        0
PavedDrive        0
WoodDeckSF        0
OpenPorchSF       0
EnclosedPorch     0
3SsnPorch         0
ScreenPorch       0
PoolArea          0
PoolQC            0
Fence             0
MiscFeature       0
MiscVal           0
MoSold            0
YrSold            0
SaleType          0
SaleCondition     0
SalePrice         0
Length: 81, dtype: int64

I actually want to see the entire output and not a shortened version with ..

$\endgroup$
2
$\begingroup$

Alternatively to Marce's answer, you can display all the rows without finding N by using:

with pd.option_context("display.max_rows", -1):
    display(train.isnull().sum())
$\endgroup$
0
$\begingroup$

I am assuming you are using a Pandas dataframe. In that case, something like

pd.options.display.max_rows = N

should work. Here, N is a number bigger than the number of rows you want to print and pd comes from import pandas as pd.

$\endgroup$
2
  • $\begingroup$ Actually its Boston. $\endgroup$ – Andros Adrianopolos Jul 5 '19 at 8:40
  • $\begingroup$ what is Boston? what type of object is your train variable? $\endgroup$ – Marce Jul 5 '19 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.