This is my data:
d = pd.DataFrame({'date': [2021.01, 2021.02, 2021.03, 2021.04],
'value': [2, 3, 4, 1]})
d
I want to convert the date column to date. It is currently float with months in decimal place (YYYY.mm)
This does not work:
pd.to_datetime(d['date'], format='%Y.%m', errors='coerce').dt.to_period('m')
