I'm not sure where to start, so I apologize for not trying.
This is the original form of my data:
df = pd.DataFrame({
'Year-Mth': ['1900-01'
,'1901-02'
,'1903-02'
,'1903-03'
,'1903-04'
,'1911-08'
,'1911-09'],
'Category': ['A','A','B','B','B','B','B'],
'SubCategory': ['X','Y','Y','Y','Z','Q','Y'],
'counter': [1,1,1,1,1,1,1]
})
df
This is the result I would like to get - the Mth-Year in the example below was re-mapped to 4-year-old buckets:

If possible, I would like to do this using a process that allows you to reuse "Year-Mth", so I can easily switch to different buckets.