bounds

method of dascore.core.annotations.AnnotationSet source

bounds(
    self ,
)-> ‘pd.DataFrame’

Return each feature’s derived bounds, one row per feature.

Rows follow iteration order: the features table’s, then lone rows. Columns are feature_id (blank for a lone row), annotation (a lone row’s index label), kind, then <dim>_min and <dim>_max per dimension, blank where the feature spans it (NaT where the set states a time somewhere along that dimension, NaN otherwise); numbers are floats. A group’s bounds envelope its members’, a path’s or polygon’s its vertices, and a path drawn only from its basis its curve, exactly. A range row’s maximum is excluded, as its half-open range says; a value’s is included, and a value alone gives equal minimum and maximum: a point.

Examples

import pandas as pd
import dascore as dc
frame = pd.DataFrame(
    {"time": [1.0, 3.0], "feature_id": ["event_1", "event_1"]}
)
ann = dc.AnnotationSet(frame, dims=("time", "distance"))
row = ann.bounds().iloc[0]
float(row["time_min"]), float(row["time_max"])
(1.0, 3.0)