我无法重命名系列的列:
tabla_paso4
Date decay
2015-06-29 0.003559
2015-09-18 0.025024
2015-08-24 0.037058
2014-11-20 0.037088
2014-10-02 0.037098
Name: decay, dtype: float64
我试过:
^{pr2}$我已经看过可能的复制品,但是不知道为什么尽管申请了:
tabla_paso4.rename(columns={'decay':'decay_acumul'},inplace=True)
返回如下序列:
Date
2015-06-29 0.003559
2015-09-18 0.025024
2015-08-24 0.037058
2014-11-20 0.037088
2014-10-02 0.037098
dtype: float64
试试看
或者
^{pr2}$您之前做错的是,您错过了
inplace=True
部分,因此重命名的df被返回,但没有被赋值。在我希望这有帮助!在
看起来你的
tabla_paso4
-是一个序列,而不是一个数据帧。在您可以从中生成带有命名列的数据帧:
相关问题 更多 >
编程相关推荐