擅长:python、mysql、java
<p>我会给你一些建议。</p>
<p>一个指针是,您希望基于一个由移位的布尔值组成的序列获取行。可能您可以使用以下方法获得新的移位序列:</p>
<pre><code>Boolean_Series = intermediate_bed.loc[:,'next_region_overlap'].shift(periods=1, freq=None, axis=0, **kwds)
</code></pre>
<p>有关此功能的更多背景信息:
<a href="http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.shift.html" rel="nofollow">http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.shift.html</a></p>
<p>第二个指针是,通过使用此移位序列,可以通过以下方式获取数据帧:</p>
<pre><code>int_bed = bed.loc[Boolean_Series, :]
</code></pre>
<p>有关索引的详细信息,请访问:
<a href="http://pandas.pydata.org/pandas-docs/dev/indexing.html" rel="nofollow">http://pandas.pydata.org/pandas-docs/dev/indexing.html</a></p>
<p>这些只是指针,我不知道这是否是一个实际的工作解决方案。</p>