tslumen.profile.summary module

Summary indicators, both at frame and series levels.

tslumen.profile.summary.df_scaled(data: Union[pandas.core.series.Series, pandas.core.frame.DataFrame])Union[pandas.core.series.Series, pandas.core.frame.DataFrame][source]

Data scaled to be between 0 and 1.

Parameters

data (Union[pd.Series, pd.DataFrame]) – Time series.

Returns

Scaled data.

Return type

Union[pd.Series, pd.DataFrame]

tslumen.profile.summary.dt_end(data: pandas.core.frame.DataFrame)Any[source]
Parameters

data (pd.DataFrame) – Time series.

Returns

End datetime.

Return type

datetime

tslumen.profile.summary.dt_start(data: pandas.core.frame.DataFrame)Any[source]
Parameters

data (pd.DataFrame) – Time series.

Returns

Start datetime.

Return type

datetime

tslumen.profile.summary.freq(data: Union[pandas.core.series.Series, pandas.core.frame.DataFrame])Optional[str][source]
Parameters

data (Union[pd.Series, pd.DataFrame]) – Time series.

Returns

Data’s inferred frequency.

Return type

int

tslumen.profile.summary.infinite(data: pandas.core.series.Series)int[source]

Count number of infinite values.

Parameters

data (pd.Series) – Time series.

Returns

Number of np.inf in data.

Return type

int

tslumen.profile.summary.length(data: pandas.core.frame.DataFrame)int[source]
Parameters

data (pd.DataFrame) – Time series.

Returns

Length of the time series.

Return type

int

tslumen.profile.summary.missing(data: pandas.core.series.Series)Any[source]

Count number of missing values.

Parameters

data (pd.Series) – Time series.

Returns

Number of np.nan in data.

Return type

int

tslumen.profile.summary.n_series(data: pandas.core.frame.DataFrame)int[source]
Parameters

data (pd.DataFrame) – Time series.

Returns

Number of series in the DataFrame.

Return type

int

tslumen.profile.summary.period(data: Union[pandas.core.series.Series, pandas.core.frame.DataFrame])Optional[int][source]
Parameters

data (Union[pd.Series, pd.DataFrame]) – Time series.

Returns

Data’s periodicity.

Return type

int

tslumen.profile.summary.sample(data: pandas.core.series.Series, sample_size: int = 10)pandas.core.series.Series[source]

Sample N records from the data.

Parameters
  • data (pd.Series) – Time series.

  • sample_size (int) – Size of the sample.

Returns

First and last sample_size/2 records in data.

Return type

pd.Series

tslumen.profile.summary.sz_total(data: pandas.core.frame.DataFrame, memory_deep: bool = True)int[source]
Parameters
  • data (pd.DataFrame) – TimeSeries data.

  • memory_deep (bool) – deeper interrogation to obtain system-level memory consumption.

Returns

Memory usage in bytes.

Return type

int

tslumen.profile.summary.zeros(data: pandas.core.series.Series)int[source]

Count number of zeros.

Parameters

data (pd.Series) – Time series.

Returns

Number of 0 in data.

Return type

int