合并数据集: 创建一个能创建dataframe的函数 def make_data(cols,ind): data={c:[strc(c)+str(i) for i in ind] for c in cols} return pd.DataFrame(data,ind) make_data('ABC' Read More
posted @ 2019-04-02 17:22 saber丶吾王 Views(198) Comments(0) Diggs(0) Edit
层级索引: index=[('a',2010),('b',2011),('c',2010'),('a',2012),('e',2010),('f',2011)] age=[18,17,18,16,18,17] 常规创建 pop =pd.Series(age,index=index) MultiInd Read More
posted @ 2019-04-02 15:32 saber丶吾王 Views(200) Comments(0) Diggs(0) Edit
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' Read More
posted @ 2019-04-02 12:04 saber丶吾王 Views(275) Comments(0) Diggs(0) Edit