python Series说明
1、Series相加,会根据索引进行操作,索引相同则数值相加,索引不同则返回NaN。
2、在pandas解释中,Nan是notanumber,它是float类型,表示数据缺失,可以参与运算。
python Series实例
#s1 lst = [1,3,5,6,10,23] s1 = pd.Series(lst,index=["A","B","C","D","E","F"]) #s2 dic = {"A":1,"B":2,"C":3,"D":2} s2 = pd.Series(dic) s3 = s2+s1
神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试