I have a dataframe like this
Anno | Mese
___________
2018 | Gennaio
2019 | Febbraio
2020 | Aprile
If the values of Mese are: Gennaio, Febbraio, Marzo --> i want Anno to be year_Q1 If the values of Mese are: Aprile, Maggio, Giugno, --> i want Anno to be year_Q2 If the values of Mese are: Luglio, Agosto, Settembre, --> i want Anno to be year_Q3 If the values of Mese are: Ottobre, Novembre, Dicembre --> i want Anno to be year_Q4
My expected output is:
Anno | Mese
___________
2018_Q1 | Gennaio
2019_Q1 | Febbraio
2020_Q2 | Aprile
How can I do it in an efficient way in Pandas?