import pandas as pd
a=pd.Series([9,8,7,6])09182736
dtype: int64 //numpy中的数据类型
a=pd.Series([9,8,7,6],index=['a','b','c','d'])
a 9
b 8
c 7
d 6
dtype: int64
创建Series
import pandas as pd
//标量值
s=pd.Series(25,index==['a','b','c','d'])//字典类型
d=pd.Series({
'a':9,'b':8,'c':7,})
a 9
b 8
c 7
dtype: int64
e=pd.Series({
'a':9,'b':8,'c':7,},index=['c','a','b','d'])从字典中进行选择操作
c 7.0
a 9.0
b 8.0
d NaN
dtype: float64
//ndarray类型创建
n=pd.Series(np.arange(5))
n=pd.Series(np.arange(5),index=np.arange(9,4,-1))