回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>对于给定的时间序列数据集,其值与ID相对应:</p>
<p>我想A,找到每个分组id的最小值,然后B,有条件地检查该分组列表是否有大于最小值(<code>minPlus2</code>)的后续值,例如:</p>
<pre><code>df = pd.DataFrame({'id': [1,1,1,1,1,1,1,2,2,2,2,2,2], 'value'[8,5,3,2,1,2,3,13,8,5,3,2,1]})
</code></pre>
<p>患者ID 1符合值(<code>df.value[6]</code>)2大于最小值/最低点值1(<code>df.value[4]</code>)2的标准。患者ID 2与标准不匹配,因为在其最低点值(<code>df.value[12]</code>)后没有数字。在</p>
<p>到目前为止,我可以使用以下方法找到最低点值:</p>
^{pr2}$
<p>我不知道一种检查B的方法,如果在mins之后有比所识别的mins大2的后续值,如果是的话,则返回到一个单独的变量中。在</p>
<p>理想的输出是那些大于每组最小值2的值。只要是在最小值之后,这些值的索引位置就不重要。在</p>
<pre><code>dfMin =
id 1
value 1
dfMinPlus2 =
id 1
value 3
</code></pre>