年份和月份合并的一种方法是对它们进行整数编码,如2014年8月的201408。
df['YearMonth'] = df['ArrivalDate'].map(lambda x: 1000*x.year + x.month)