I have the following dataframe df:
date USDBRL
0 1994-01-31 458.6600
1 1994-02-28 637.4500
2 1994-03-30 913.3450
3 1994-04-29 1302.2800
4 1994-05-31 1875.2700
.. ... ...
317 2020-06-30 5.4760
318 2020-07-31 5.2033
319 2020-08-31 5.4713
320 2020-09-30 5.6407
321 2020-10-09 5.5393
I would like to change all date values to the first day of the month.
I tried this:
df['date'] = datetime(df['date'].dt.year, df['date'].dt.month, 1)
but I'm getting syntax error:
TypeError: cannot convert the series to <class 'int'>
