tslumen.profile.distribution module

Distribution functions.

tslumen.profile.distribution.binned(data: pandas.core.series.Series, nbins: Optional[int] = None)pandas.core.series.Series[source]

Bins the data in nbins bins.

Parameters
  • data (pd.Series) – Timeseries to bin.

  • nbins (Optional[int]) – Number of bins, if not provided uses the Freedman-Diaconis rule to calculate the number of bins: bw=2×IQR×n^{−1/3}; n_bins=(max−min)/bw

Returns

Series with the counts, indexed by bins.

Return type

pd.Series

tslumen.profile.distribution.pd_percentiles(data: pandas.core.series.Series)pandas.core.frame.DataFrame[source]

Calculates percentiles – supporting data for a PP-plot.

Parameters

data (pd.Series) – Timeseries to data.

Returns

DataFrame with 3 columns, theoretical_percentiles, sample_percentiles and reference

Return type

pd.DataFrame

tslumen.profile.distribution.pd_quantiles(data: pandas.core.series.Series)pandas.core.frame.DataFrame[source]

Calculates quantiles – supporting data for a QQ-plot.

Parameters

data (pd.Series) – Timeseries data.

Returns

DataFrame with 3 columns, theoretical_quantiles, sample_quantiles and reference

Return type

pd.DataFrame