#%%merge
df_1 = df_1.merge(get_pedal_cnt_df, on=['dt','vin'], how='left').sort_values(by='总次数', ascending=False).reset_index(drop=True)
#%%取几列
get_pedal_cnt_df = get_pedal_cnt_df[['vin','dt','right_cnt','left_cnt']]
#%%改列名
dt_count.columns = ['策略描述','次数','车辆数']
#%%分组后每组去重数
vin_count = df.groupby('event_description')['vin'].nunique()
#删除某几列
detal_dt_1=detal_dt.drop(['dt','act_produceover_time'],axis=1)
#%%string
dataframe代码存储
于 2022-10-25 10:56:40 首次发布