题解 | #牛客网每日正确与错误的答题次数#
牛客网每日正确与错误的答题次数
https://www.nowcoder.com/practice/bd74b186d5954eb69c00ee804cebe364
import pandas as pd df = pd.read_csv('nowcoder.csv', sep=',') df['year-month-day'] = pd.to_datetime(df['date'], format='%Y-%m-%d %H:%M').dt.date cond = (pd.to_datetime(df['date']).dt.year == 2021) & (pd.to_datetime(df['date']).dt.month == 12) df1 = df[cond] df2 = df1.groupby(['result', 'year-month-day'])['question_id'].count() print(df2)