np_univariate

NumPy-backed data providers.

class pysatl_cpd.data.providers.plain.np_univariate.NDArrayUnivariateProvider(data, annotation)[source]

Bases: DataProvider[Number, AnnotationT], Generic

Data provider for 1-D NumPy arrays.

Parameters:
Raises:

ValueError – If the data is not 1-dimensional.

__init__(data, annotation)[source]
Parameters:
Return type:

None

__iter__()[source]

Iterate over series values.

Returns:

Iterator over the underlying NumPy scalars.

Return type:

Iterator[double]

__len__()[source]

Return the series length.

Returns:

Number of samples in the series.

Return type:

int

property annotation: AnnotationT

Return the annotation associated with this timeseries.

Returns:

The annotation object for this series.

Return type:

annotation

property raw_data: UnivariateNumericArray

Return a copy of the underlying data array.

Returns:

Copy of the underlying univariate numeric array.

Return type:

raw_data

cut(start, stop, *, annotation=None)[source]

Extract a slice of the timeseries data.

Parameters:
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:
Returns:

New provider with merged data and annotation.

Return type:

NDArrayUnivariateProvider