'How to calculate the bimester of the year?

a question how can I create a column based on a date that tells me to which bimester of the year it belongs?

For example, with this function I calculate the quarter, but I have not been able to calculate the bimester, does the .dt function have one already created?

data_2020['TRIMESTRE'] = data_2020['FECHA_COMPRA'].dt.quarter



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source