import pandas as pd df = pd.read_csv("nowcoder.csv", sep=",", encoding="utf8") # date列 只保留 日期 df.date = pd.to_datetime(df["date"]) df['date'] = df['date'].dt.strftime('%Y-%m-%d') # 总用户数量 cnt = df['user_id'].count() # mermge(用户id) data = pd.merge(left=df, ...