I'm trying to add a new column to a pandas data set that take the numeric month from one column and stores the corresponding season into the new column.
So in essence,
if month == 12, season = 'Winter'
elif month == 2, season = 'Spring'
elif month == 5, season = 'Summer'
else month == 8, season = 'Fall'
I haven't seen a really clear solution for this. I've seen how to do it with 2 conditional values, but I'm still fairly new to pandas and python.
Edit: I was able to get it working with one of the solutions listed below (Thanks!), but I should have mentioned that I also need to include months 1,3,4,6,7,9,10,11
df.shape=(2,12)) then you can do a join on the month column.