import pandas as pd df = pd.read_csv('nowcoder.csv',delimiter=',') df['year-month-day'] = pd.to_datetime(df['date'],format='%Y-%m-%d').dt.date print(df.groupby(['result','year-month-day'])['result'].count()) # 类似SQL中的select result,time_format('date',) from nowcoder group by result ,year-month-day