import pandas as pd # 1.Series用作字典 mydict = {'red': 2000, 'blue': 1000, 'yellow': 500, 'orange': 1000} mys1 = pd.Series(mydict) print(mys1) color = ['red','yellow','orange','black','green'] mys2 = pd.Series(mydict,index=color) print(mys2)#缺失值pandas会添加NaN # 2.Series对象之间的运算 标签对齐不一致也可运算 mys = mys1 + mys2 print(mys)