One - One Code All

Blog Content

pandas中的DataFrame按指定顺序输出所有列

Python 统计学-科学计算   2010-11-08 16:30:05

输出所有栏目列名:df.columns

cols=['id','name']
df=df.ix[:,cols]

df=df.ix[:,cols]语句表示,DataFrame的行索引不变,列索引是cols中给定的索引。


上一篇:菩萨所行法--《大宝积经-普明菩萨会》
下一篇:Spring.properties文件中将元素作为数组获取

The minute you think of giving up, think of the reason why you held on so long.