加载数据分析使用的库
加载数据
import pandas as py
import numpy as np
import matplotlib.pyplot as plt
##警告信息columns have types,需要设置dtype
df=pd.read_csv('./anli/beijing_houst_price.csv',dtype={
'id':'str','tradeTime':'str','livingRoom':'str','drawingRoom':'str','bathRoom':'str'})
#查看数据大致情况
df.head()
id tradeTime followers totalPrice price square livingRoom drawingRoom kitchen bathRoom floor buildingType buildingStructure ladderRatio elevator fiveYearsProperty subway district communityAverage
0 101084782030 2016-08-09 106 415.0 31680 131.00 2 1 1 1 高 26 1.0 6 0.217 1.0 0.0 1.0 7 56021.0
1 101086012217 2016-07-28 126 575.0 43436 132.38 2 2 1 2 高 22 1.0 6 0.667 1.0 1.0 0.0 7 71539.0
2 101086041636 2016-12-11 48 1030.0 52021 198.00 3 2 1 3 中 4 4.0 6 0.500 1.0 0.0 0.0 7 48160.0
3 101086406841 2016-09-30 138 297.5 22202 134.00 3 1 1 1 底 21 1.0 6 0.273 1.0 0.0 0.0 6 51238.0
4 101086920653 2016-08-28 286 392.0 48396 81.00 2 1 1 1 中 6 4.0 2 0.333