透视表 下面这种话在用透视表做去重计算的时候很常见 df_pivot = pd.pivot_table(df,index = 'name', columns = 'first', values = 'value', aggfunc = { 'value':