pynapple.core.interval_set.IntervalSet.__init__#
- IntervalSet.__init__(start, end=None, time_units='s')[source]#
If start and end are not aligned, meaning that: 1. len(start) != len(end) 2. end[i] > start[i] 3. start[i+1] > end[i] 4. start and end are not sorted,
IntervalSet will try to “fix” the data by eliminating some of the start and end data points.
- Parameters:
start (numpy.ndarray or number or pandas.DataFrame or pandas.Series or iterable of (start, end) pairs) –
Beginning of intervals. Alternatively, the end argument can be left out and start can be one of the following:
IntervalSet
pandas.DataFrame with columns [“start”, “end”]
iterable of (start, end) pairs
a single (start, end) pair
end (numpy.ndarray or number or pandas.Series, optional) – Ends of intervals.
time_units (str, optional) – Time unit of the intervals (‘us’, ‘ms’, ‘s’ [default]).
- Raises:
RuntimeError – If start and end arguments are of unknown type.