Reputation: 1185
I have a data frame with an index that is a DateTime stamp. I would like to change it by formatting the index. I have to use strftime to apply but when I used to like this it doesn't work.
df.index = df.index.map(strftime('%Y-%m-%d'))
Error: 'strftime' is not defined
But it work just fine when I do like this:
df1.index[0].strftime('%Y-%m-%d')
I would like to apply for all my index. Suggestions, please?
Upvotes: 2
Views: 57