timeatlas.time_series.TimeSeries

class timeatlas.time_series.TimeSeries(series: Union[pandas.core.series.Series, pandas.core.frame.DataFrame] = None, metadata: timeatlas.metadata.metadata.Metadata = None, class_label: str = None)

A TimeSeries object is a series of time indexed values.

__init__(series: Union[pandas.core.series.Series, pandas.core.frame.DataFrame] = None, metadata: timeatlas.metadata.metadata.Metadata = None, class_label: str = None)

Defines a time series

A TimeSeries object is a series of time indexed values.

Parameters
  • series – Series or DataFrame containing the values and labels

  • metadata – Metadata-object

  • class_label – class label

Methods

__init__([series, metadata, class_label])

Defines a time series

apply(func[, ts])

Wrapper around the Pandas apply function

boundaries()

Get a tuple with the TimeSeries first and last index

copy([deep])

Copy a TimeSeries

create(start, end[, freq, metadata])

Creates an empty TimeSeries object with the period as index

describe([percentiles, include, exclude])

Describe a TimeSeries with the describe function from Pandas

duration()

Get the duration of the TimeSeries

empty()

Empty the TimeSeries (fill all values with NaNs)

end()

Get the last Timestamp of a TimeSeries

fill(value)

Fill a TimeSeries with values

frequency()

Get the frequency of a TimeSeries

group_by(freq[, method])

Groups values by a frequency.

interpolate(*args, **kwargs)

Wrapper around the Pandas interpolate() method.

kurtosis()

Get the kurtosis of a TimeSeries

max()

Get the maximum value of a TimeSeries

mean()

Get the mean value of a TimeSeries

median()

Get the median value of a TimeSeries

merge(ts)

Merge two time series and make sure all the given indexes are sorted.

min()

Get the minimum value of a TimeSeries

normalize(method)

Normalize a TimeSeries with a given method

pad(limit[, side, value])

Pad a TimeSeries until a given limit

plot(*args, **kwargs)

Plot a TimeSeries

resample(freq[, method])

Convert TimeSeries to specified frequency.

round(decimals)

Round the values in the series.values

skewness()

Get the skewness of a TimeSeries

sort(*args, **kwargs)

Sort a TimeSeries by time stamps

split_at(timestamp)

Split a TimeSeries at a defined point and include the splitting point in both as in [start,…,at] and [at,…,end].

split_in_chunks(n)

Split a TimeSeries into chunks of length n

start()

Get the first Timestamp of a TimeSeries

time_detlas()

Compute the time difference in seconds between each timestamp of a TimeSeries

to_array()

Convert a TimeSeries to Numpy Array

to_darts()

Convert a TimeSeries to Darts TimeSeries

to_df()

Converts a TimeSeries to a Pandas DataFrame

to_pickle(path)

Export a TimeSeries to Pickle

to_text(path)

Export a TimeSeries to text format

trim([side])

Remove NaNs from a TimeSeries start, end or both