I am working on a data frame which contains date. I want to create a new column to classify the period of the date in a year. That means that I will assume as every 2 months as a range. But my starting date will be August. Thus, Aug to Sep is 1, Oct to Nov is 2, Dec to Jan is 3, Feb to Mar is 4 and Apr to May is 5. The sample date is as follow: data =pd.DataFrame() data ['Date'] = ['27-03-2019','08-10-2019','09-04-2019','09-08-2018'] data.period = pd.to_datetime(data['Date']) The expected outcome as range in a new column would be as follows: How can I do that? Continue reading...