MyData数据集特定行分组后均值比值与阈值0.01比较的条件分组需求
分组均值比值计算与阈值对比
Hey there, let's work through this problem with your MyData dataset clearly:
Step 1: Isolate the target group rows
We're focusing on rows 1 and 2, so let's pull their D and E column values:
- Row 1: D = 52, E = 0.4
- Row 2: D = 116, E = 1.5
Step 2: Calculate the mean ratio
Following your requirement, we'll compute the mean of E, the mean of D, then divide the two:
- E column mean:
(0.4 + 1.5) / 2 = 0.95 - D column mean:
(52 + 116) / 2 = 84 - Final ratio:
0.95 / 84 ≈ 0.011309524
Step 3: Compare against the 0.01 threshold
The calculated ratio 0.011309524 is greater than the threshold 0.01. This means you'd proceed with the "……" logic you referenced (e.g., flagging the group for further review, running a specific processing workflow, etc.)
内容的提问来源于stack exchange,提问作者Miki
相关产品推荐
相关产品推荐

