import numpy as py
import pandas as pd
Series对象
data= pd.Series([0.25,0.5,0.75,1.0]) 默认索引是数字
data=...pd.Series([0.25,0.5,0.75,1.0],index=['a','b','c','d']) 用字符串定义索引,也可以用不连续的索引
data['b']
data['a':'c...[0.25,0.5,0.75,1.0],
index=['a','b','c','d'
)
判断data中是否有a索引
'a' in data
获取data索引
data.keys... )
x.index获取行索引标签,x.columns获取列索引标签
pandas 的index对象
创建对象
ind=pd.Index([2,5,6,7,11])
切片,索引
ind[1],...(method='ffill') 用缺失值前面的有效值填充,bfill用后面的有效值填充
data.fillna(method='ffill',axis=1) 每行的前面有效值填充
如果缺失值前面没有值