import calendar
# df = your dataframe
df = pd.DataFrame([[1,2],[2,4],[3,5]], columns=['Passengers 2009M01', 'Passengers 2009M02'])
column_names = df.columns.to_list()
for each_column in column_names:
if('Passengers' in each_column):
dd = each_column.split(' ')[-1]
year, month= dd.split('M')
month = calendar.month_name[int(month)].lower()[:3]
df.rename(columns={each_column: f'{year}-{month}'}, inplace=True)
output
2009-jan 2009-feb
0 1 2
1 2 4
2 3 5
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…