I have created a dataframe with a range of dates from 8/1/18 to today() and am trying to assign a month_start_date to each date (eg: 2018/08/04 would be 2018/08/01).
I have been able to get the day of the date into month_start_date, but I'm really just trying to replace the day in the date column with 1 for all dates.
import pandas as pd
from datetime import datetime
datelist = pd.date_range(start='2018-08-01', end=datetime.today())
df_columns = ['date']
df = pd.DataFrame(datelist, columns = df_columns)
df['month_start_date'] = df['date'].dt.day
print(df)
date month_start_date
0 2018-08-01 1
1 2018-08-02 2
2 2018-08-03 3
3 2018-08-04 4
4 2018-08-05 5