如何筛选出 2017年的全部数据
(date目前是 object/我会改成日期类型)
两个方法试试:
如果不为日期格式
data[data['date'].str[:4]=='2017']
如果为日期格式
data[data['date'].year==2017]