How do site means combine when request volumes differ?
average multiplies observations by their weights and divides by total weight. Counts can recover an overall mean from group means.
numpy.average in practice
Sites with one and three requests average ten and thirty milliseconds. Their pooled mean is 25 milliseconds if both sites use the same measurement definition.
import numpy as np
np.average([10,30],weights=[1,3])Result 25.0
中文
各站点响应时间均值如何按请求量合并?
average 用权重乘各观测再除以权重和,可用样本量恢复总体均值。
numpy.average 算例
两站分别处理 1 和 3 个请求,平均耗时为 10 和 30 毫秒,总体为 25 毫秒。前提是这些均值覆盖同种请求和同一统计口径。
import numpy as np
np.average([10,30],weights=[1,3])结果 25.0