np_univariate
NumPy-backed data providers.
- class pysatl_cpd.data.providers.plain.np_univariate.NDArrayUnivariateProvider(data, annotation)[source]
Bases:
DataProvider[Number,AnnotationT],GenericData provider for 1-D NumPy arrays.
- Parameters:
- Raises:
ValueError – If the data is not 1-dimensional.
- __init__(data, annotation)[source]
- Parameters:
data (NumericArray)
annotation (AnnotationT)
- Return type:
None
- property annotation: AnnotationT
Return the annotation associated with this timeseries.
- Returns:
The annotation object for this series.
- Return type:
- property raw_data: UnivariateNumericArray
Return a copy of the underlying data array.
- Returns:
Copy of the underlying univariate numeric array.
- Return type:
- cut(start, stop, *, annotation=None)[source]
Extract a slice of the timeseries data.
- Parameters:
start (
int) – Start index of the slice (inclusive).stop (
int) – Stop index of the slice (inclusive).annotation (
Optional[TypeVar(AnnotationT, bound=UnlabeledTimeseriesAnnotation)]) – Optional annotation for the sliced data.
- Returns:
New provider containing the sliced data.
- Return type:
NDArrayUnivariateProvider[TypeVar(AnnotationT, bound=UnlabeledTimeseriesAnnotation)]
- classmethod merge(providers, annotation_builder=None)[source]
Merge multiple providers into a single provider.
- Parameters:
providers (
Sequence[Self]) – Sequence of providers to merge.annotation_builder (
Callable[[Sequence[TypeVar(AnnotationT, bound=UnlabeledTimeseriesAnnotation)]],TypeVar(AnnotationT, bound=UnlabeledTimeseriesAnnotation)] |None) – Optional function to build the merged annotation.
- Returns:
New provider with merged data and annotation.
- Return type: