Pandas:将计算列添加到pivot_table

时间:2015-02-19 18:17:32

标签: python pandas pivot-table

不幸的是,这个 Add calculated column to a pandas pivot table没有帮助我

我的代码:

table = pd.pivot_table(df,index=['JOBFAMILIE1', 'POS_AUSPR1'], columns=['GESCHL'], values=['GESAMTDIREKT'], aggfunc={'GESAMTDIREKT': [np.mean,np.count_nonzero]}, fill_value ="-")

结果表:

My resulting Table:

现在我需要计算平均值“männlich”和“weiblich”的差异

0 个答案:

没有答案
相关问题