- pandas的常用数据类型
- pandas之Series创建
- pandas之Series切片和索引
1.Series 一维,带标签数组
2.Dataframe 二维,Series容器
import pandas as pd t1=pd.Series([1,4,6,2,8,6],index=list("abcdef")) print(t1) print(t1.head(2)) print(t1.tail(2)) tem_dict={"name":"yiyi","age":"18"} t2=pd.Series(tem_dict)pandas之Series切片和索引
import pandas as pd t1=pd.Series([1,4,6,2,8,6],index=list("abcdef")) print(t1) print(t1.head(2)) print(t1.tail(2)) tem_dict={"name":"yiyi","age":"18"} t2=pd.Series(tem_dict) #series切片和索引 print(t2) print(t2["name"]) print(t2["age"]) print(t2[0]) print(t2[1]) print(t1[t1>3])
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)