0

I need to get for each value, beginning of week (Monday). Here is dataframe that I have

enter image description here

And I want to get beginning of week purchase_date_x column to create new column with new column

Corralien
  • 109,409
  • 8
  • 28
  • 52

1 Answers1

0

You can use the following code

df['Monday_date_x'] = df['Date'].dt.to_period('W').dt.start_time

You can find more information on it here: Get week start date (Monday) from a date column in Python (pandas)?

mozway
  • 194,879
  • 13
  • 39
  • 75
ArchAngelPwn
  • 2,891
  • 1
  • 4
  • 17