You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

技术需求:排除0值计算数据集各列分组均值

数据集处理需求与结果

原始数据集

W   X    Y    Z
A_rep1     0  15   10   2   
A_rep2     2  14    4   8
A_rep3    15   0    8  22
A_rep4    18   3    0   9
A_rep5     0  12    0  22    
B_rep1    13   0   12  80 
B_rep2    14   2   10  45
B_rep3    15  10   12  36 
B_rep4    89  18   22  78 
B_rep5     0  22   16   0
C_rep1    15   0   12   0
C_rep2    12   0   17   5
C_rep3    22   4   50  47
C_rep4     0  14    0   0 
C_rep5     0   5    4  12 

计算规则

  • 按A、B、C三个分组,分别计算每一列的均值,计算时需排除该分组内对应列的0值
  • 示例:W列A组仅统计A_rep2(2)、A_rep3(15)、A_rep4(18)的数值,排除A_rep1和A_rep5的0值,均值为(2+15+18)/3≈11.67

处理后数据集

W          X       Y        Z
A_rep1       0         15      10        2   
A_rep2       2         14       4        8
A_rep3      15          0       8       22
A_rep4      18          3       0        9
A_rep5       0         12       0       22    
B_rep1      13          0      12       80 
B_rep2      14          2      10       45
B_rep3      15         10      12       36 
B_rep4      89         18      22       78 
B_rep5       0         22      16        0
C_rep1      15          0      12        0
C_rep2      12          0      17        5
C_rep3      22          4      50       47
C_rep4       0         14       0        0 
C_rep5       0          5       4       12 
Mean_A     11.67      11.00    7.33     12.60
Mean_B     32.75      13.00    14.40     59.75
Mean_C     16.33       7.67    20.75     21.33

内容的提问来源于stack exchange,提问作者Reda

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.17 12:20:31