I have a dataframe with separated columns of just Year and Month like:
Year Month
2001 1
2001 2
2001 3
.
.
2010 1
2010 2
.
Converting to pd.datetime using pd.to_datetime(df[['year', 'month']]) requires days to match the format so I get the error:
ValueError: to assemble mappings requires at least that [year, month, day] be specified: [day] is missing
I felt like I could just fill a new column with Day = 1 repeated but I would like to avoid this because I want to create a time series by the Year-Month only.
Is there a way to map Year-Month to a date to graph properly?