data.regdate # 查看时间序列 # 按年份分箱 data['year'] = data.regdate.apply(lambda x: x.year) data.year 按照该列数据进行正常分箱操作即可