在Python中为高维数据命名列

时间:2015-05-08 06:25:31

标签: python bigdata renaming

当我读入.txt文件时,python会给出不太有用的自动名称(即0,0.1,0.2,0.3 ......)。如何重命名我的所有列而不必显式输入所有列?

例如,如何快速将变量V1重命名为V200?

1 个答案:

答案 0 :(得分:0)

df.columns = ["feature_"+str(x) for x in range(len(df.columns))]