I have a dataframe
df = {'Month': [1, 8], 'Year': [2015, 2020]}
df = pd.DataFrame(data = df)
df
Would like to mutate it as a new column.
Desired output:
df = {'Month': [1, 8], 'Year': [2015, 2020], 'Quarter': ['Q12015', 'Q32020']}
df = pd.DataFrame(data = df)
df
Also would be grateful for comments what is the best way to treat this data for modelling with scikit-learn
. For now I am thinking about strings and categorical variables without dummy variables, but appreciate any tips here. Thanks!