【发布时间】:2016-11-08 17:55:08
【问题描述】:
我正在尝试处理用于 DataScience 的数据集,但它没有列名。 df.head()的输出如下图:
1 73 Not in universe 0 0.1 0.2 Not in universe.1
0 2 58 Self-employed-not incorporated 4 34 0 Not in universe
1 3 18 Not in universe 0 0 0 High school
2 4 9 Not in universe 0 0 0 Not in universe
3 5 10 Not in universe 0 0 0 Not in universe
4 6 48 Private 40 10 1200 Not in universe
我想看到的是
0 1 73 Not in universe 0 0.1 0.2 Not in universe.1
1 2 58 Self-employed-not incorporated 4 34 0 Not in universe
2 3 18 Not in universe 0 0 0 High school
3 4 9 Not in universe 0 0 0 Not in universe
4 5 10 Not in universe 0 0 0 Not in universe
5 6 48 Private 40 10 1200 Not in universe
我可以分配随机的列名,但有更好的方法吗?
【问题讨论】:
标签: python python-2.7 numpy pandas