Reputation: 157
I tried this
print(housing.columns[housing.isnull().any()], housing.isnull().sum().sum())
and Got the following output:
Index(['total_bedrooms'], dtype='object') 207
But I'm trying to get the following output:
(total_bedrooms, 207 )
I believe there's a more intuitive way to get the answer I want than the way I did. Any help would be appreciated.
Upvotes: 1
Views: 90
Reputation: 323356
We can do in one line
[*df.isnull().sum().loc[lambda x : x>0].items()]
Upvotes: 1