新聞中心
說明

主要從事網(wǎng)頁設(shè)計、PC網(wǎng)站建設(shè)(電腦版網(wǎng)站建設(shè))、wap網(wǎng)站建設(shè)(手機版網(wǎng)站建設(shè))、成都響應(yīng)式網(wǎng)站建設(shè)、程序開發(fā)、微網(wǎng)站、微信平臺小程序開發(fā)等,憑借多年來在互聯(lián)網(wǎng)的打拼,我們在互聯(lián)網(wǎng)網(wǎng)站建設(shè)行業(yè)積累了豐富的成都網(wǎng)站設(shè)計、成都網(wǎng)站制作、網(wǎng)絡(luò)營銷經(jīng)驗,集策劃、開發(fā)、設(shè)計、營銷、管理等多方位專業(yè)化運作于一體,具備承接不同規(guī)模與類型的建設(shè)項目的能力。
1、python+data+analysis的組合縮寫,是python中以numpy和matplotlib為基礎(chǔ)的第三方數(shù)據(jù)分析庫
2、共同構(gòu)成python數(shù)據(jù)分析的基本工具包,享有三個劍客的名字。
安裝
打開cmd,依次輸入以下三個命令。
pip install Pandas -i https://pypi.tuna.tsinghua.edu.cn/simple pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
pandas選擇數(shù)據(jù)
import pandas as pd
import numpy as np
dates = pd.date_range('20210301', periods=6)
df1 = pd.DataFrame(np.arange(24).reshape((6, 4)), index=dates, columns=['A', 'B', 'C', 'D'])
print(df1)pandas賦值及操作
import pandas as pd
import numpy as np
dates = pd.date_range('20210301', periods=6)
df1 = pd.DataFrame(np.arange(24).reshape((6, 4)), index=dates, columns=['A', 'B', 'C', 'D'])
print(df1)pandas對于空數(shù)據(jù)的處理
import pandas as pd
import numpy as np
dates = pd.date_range('20210301', periods=6)
df1 = pd.DataFrame(np.arange(24).reshape((6, 4)), index=dates, columns=['A', 'B', 'C', 'D'])
df2 = pd.DataFrame(df1, index=dates, columns=['A', 'B', 'C', 'D', 'E', 'F'])
s1 = pd.Series([3, 4, 6, 7], index=dates[:4]) # 對第一個到第四個數(shù)據(jù)進行賦值
s2 = pd.Series([32, 5, 2, 1], index=dates[2:]) # 對第三個數(shù)據(jù)到最后一個數(shù)據(jù)進行賦值
df2['E'] = s1
df2['F'] = s2
print(df2)以上就是python中pandas的知識點整理,希望對大家有所幫助。更多Python學(xué)習(xí)指路:創(chuàng)新互聯(lián)Python教程
本文教程操作環(huán)境:windows7系統(tǒng)、Python 3.9.1,DELL G3電腦。
分享標(biāo)題:創(chuàng)新互聯(lián)Python教程:python中pandas的知識點整理
當(dāng)前URL:http://fisionsoft.com.cn/article/cdgicej.html


咨詢
建站咨詢
