![](/img/trans.png)
[英]None of [Int64Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype='int64', name='index')] are in the [index]
[英]How to convert Index column with name 'Date' to weekday name in dataframe. The index format is dtype: int64
尝试:
daynumber = [0,1,2,3,4,5,6]
weekday = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']
df = df.rename(index=dict(zip(daynumber,weekday)))
df
output:
Date ...
Monday ...
Tuesday ...
Wednesday ...
Thursday ...
Friday ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.