INNER CODE UNIT · Python
merge_runs
open2c/bioframe · src/bioframe/extras.py:653
def merge_runs(
df: pd.DataFrame,
col: str,
*,
allow_overlaps: bool = False,
agg: dict | None = None,
cols: tuple[str, str, str] | None = None,
) -> pd.DataFrame:
"""
Merge runs of spatially consecutive intervals sharing the same value of
``col``.
Parameters
----------
df : DataFrame
A bioframe dataframe.
col : str
The column to compress runs of values for.