学习python-10 Minutes to pandas

http://pandas.pydata.org/pandas-docs/stable/10min.html

 

1.Object Creation

-Series

s = pd.Series

#a list of values

-DataFrame

df = pd.DataFrame

#a numpy array

 

df.dtypes

df.

 

2.Viewing Data

df.head()#DataFrame矩阵前五行

df.tail(3)#倒数三行

df.index#行

df.columns#列

df.values#值

df.describe()#df矩阵的count,mean,std,min,25%,50%,75%,max

df.T #转置df

df.sort_index(axis=1,ascending=False)#列ABCD→DCBA

df.sort_values(by = 'B') #数据按照B列降序排列

 

3.Selection

-Getting

df['A']

 

转载于:https://www.cnblogs.com/freedomphy/p/6754405.html

你可能感兴趣的:(学习python-10 Minutes to pandas)