2.16 分组:中位数

 

根据员工薪资表,统计每个部门工资的中位数。

ID NAME DEPT SALARY
1 Rebecca R&D 7000
2 Ashley Finance 11000
3 Rachel Sales 9000
4 Emily HR 7000
5 Ashley R&D 16000

脚本:

A
1 =T(“salary.xlsx”)
2 =A1.groups(DEPT;median(,SALARY):MedianSalary)

运行结果:

DEPT MedianSalary
Administration 9500.0
Finance 7000.0
HR 7000
Marketing 7000
Production 6500