df = pd.read_csv('housing.csv')df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 13580 entries, 0 to 13579
Data columns (total 21 columns):# Column Non-Null Count Dtype
--- ------ -------------- ----- 0 Suburb 13580 non-null object 1 Address 13580 non-null object 2 Rooms 13580 non-null int64 3 Type 13580 non-null object 4 Price 13580 non-null float645 Method 13580 non-null object 6 SellerG 13580 non-null object 7 Date 13580 non-null object 8 Distance 13580 non-null float649 Postcode 13580 non-null float6410 Bedroom2 13580 non-null float6411 Bathroom 13580 non-null float6412 Car 13518 non-null float6413 Landsize 13580 non-null float6414 BuildingArea 7130 non-null float6415 YearBuilt 8205 non-null float6416 CouncilArea 12211 non-null object 17 Lattitude 13580 non-null float6418 Longtitude 13580 non-null float6419 Regionname 13580 non-null object 20 Propertycount 13580 non-null float64
dtypes: float64(12), int64(1), object(8)
memory usage: 2.2+ MB
Suburb False
Address False
Rooms False
Type False
Price False
Method False
SellerG False
Date False
Distance False
Postcode False
Bedroom2 False
Bathroom False
Car True
Landsize False
BuildingArea True
YearBuilt True
CouncilArea True
Lattitude False
Longtitude False
Regionname False
Propertycount False
dtype: bool
Index(['Suburb', 'Address', 'Rooms', 'Type', 'Price', 'Method', 'SellerG','Date', 'Distance', 'Postcode', 'Bedroom2', 'Bathroom', 'Car','Landsize', 'BuildingArea', 'YearBuilt', 'CouncilArea', 'Lattitude','Longtitude', 'Regionname', 'Propertycount'],dtype='object')
has_null_cols = df.columns[df.isnull().any()].tolist()
has_null_cols# ['Car', 'BuildingArea', 'YearBuilt', 'CouncilArea']
df.isnull().any()[df.isnull().any() == True].index.tolist()# ['Car', 'BuildingArea', 'YearBuilt', 'CouncilArea']
df.isnull().sum()[df.isnull().sum() > 0].index.tolist()# ['Car', 'BuildingArea', 'YearBuilt', 'CouncilArea']
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/963870.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!