How do i convert a pandas index of strings to datetime format
my dataframe 'df' is like this
value
2015-09-25 00:46 71.925000
2015-09-25 00:47 71.625000
2015-09-25 00:48 71.333333
2015-09-25 00:49 64.571429
2015-09-25 00:50 72.285714
but the index is of type string, but i need it a datetime format because i get the error
'Index' object has no attribute 'hour'
when using
df['A'] = df.index.hour
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…