I have a Pandas dataframe with a time series index based on a date range applied using date_time, as follows:
Column A
2016-11-24 00:00:00 4.0
2016-11-24 01:00:00 7.8
2016-11-24 02:00:00 95.1
2016-11-24 03:00:00 78.4
etc
What I'd like to do is create a new column that applies a factor to Column A based on the month in the index.
Correction factors: September = 1, October = 2, November = 3, December = 4, etc.
So, in the example above case, because the month is November, the result would be:
Column A Column B
2016-11-24 00:00:00 4.0 12
2016-11-24 01:00:00 7.8 23.4
2016-11-24 02:00:00 95.1 285.3
2016-11-24 03:00:00 78.4 235.2
etc
I have tried a number of solutions some trouble with this. Does anyone have any tips?