This seems like it should be easy but I can find no answer when googling. Say I have some variable k that is of type pandas.Period, and whose value is:
Period('2018-11', 'M')
How do I add n months to this variable. For example if n is 3 i would want k to be
Period('2019-02', 'M')
I have tried the following:
k.month = k.month + 12
But this fails saying:
AttributeError: attribute 'month' of 'pandas._libs.tslibs.period._Period' objects is not writable