一朋蔫、讀取數(shù)據(jù)
數(shù)據(jù)內(nèi)容如下:
ymd,bwendu,ywendu,tianqi,fengxiang,fengli,aqi,aqiinfo,aqiLevel
2018-01-01,3C,-6C,多云,東北風(fēng),1-2級(jí),59,良,2
2018-01-02,4C,-6C,多云,東北風(fēng),3-4級(jí),60,良,2
2018-01-03,5C,-6C,多云,東北風(fēng),5-6級(jí),61,良,2
df = pd.read_csv(data_path)
image.png
二罚渐、describe 用法
df.describe()
ps:該函數(shù)會(huì)抽取df中的數(shù)字列進(jìn)行計(jì)算
image.png
三、mean驯妄、max荷并、min 用法
df['bwendu'].mean()
df['bwendu'].max()
df['bwendu'].min()
image.png
四、去重 unique 用法
df['fengli'].unique()
image.png
五青扔、value_counts值數(shù)量統(tǒng)計(jì)用法
df['bwendu'].value_counts()
image.png
六源织、協(xié)方差cov、相關(guān)性corr用法
df.cov() #協(xié)方差矩陣
df.corr()
df['bwendu'].corr(df['aqi'])
df['bwendu'].corr(df['bwendu']-df['ywendu'])
image.png