📜  pandas 均值和求和 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:20.671000             🧑  作者: Mango

代码示例1
d = {'Missed':'Sum1', 'Credit':'Sum2','Grade':'Average'}
df=df.groupby('Name').agg({'Missed':'sum', 'Credit':'sum','Grade':'mean'}).rename(columns=d)