I need to get for each value, beginning of week (Monday). Here is dataframe that I have
And I want to get beginning of week purchase_date_x
column to create new column with new column
I need to get for each value, beginning of week (Monday). Here is dataframe that I have
And I want to get beginning of week purchase_date_x
column to create new column with new column
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)?