Edit date value within a dataframe

Asked

Viewed 63 times

0

Print do DataFrame

I have this Dataframe and the date is in the following format: '2020-08-01'

I would like to write a loop that iterates on each line and performs the switch to the following format: '01/08'

I’m using the Jupyter, pandas... thank you very much

2 answers

1

Pandas has the strftime function if it can convert the date to a string with the format you want. Link to documentation.

df["Date"].dt.strftime("%d/%m/%y")

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.