1、根据日期判断是星期几,周一为0,周日为6
df['week'] = df['数据时间'].dt.dayofweek
2、筛选‘week’为5、6(周六日,可以根据实际需求改变)的数据,并删掉‘week’字段
df = df[df['week'].isin([5, 6])]
df.drop(columns='week', inplace=True)
1、根据日期判断是星期几,周一为0,周日为6
df['week'] = df['数据时间'].dt.dayofweek
2、筛选‘week’为5、6(周六日,可以根据实际需求改变)的数据,并删掉‘week’字段
df = df[df['week'].isin([5, 6])]
df.drop(columns='week', inplace=True)