This class extends a Python List and represents multiple time series, they can be univariate or multivariate (not implemented yet). Therefore, each item in a TimeSeriesDataset has its own time index.
List
Thanks to its ability to handle multiple indices, this class provides a set of method to go from raw data, with unknown characteristics (frequencies, start, end, etc.), to clean data that is easy to process, model or analyze.
Warning
The aim of a TimeSeriesDataset object is to be immutable
TimeSeriesDataset(data)
TimeSeriesDataset
Defines a set of time series
create(length, start, end[, freq])
create
Create an empty TimeSeriesDataset object with a defined index and period
append(item)
append
Append a TimeSeries to TimeSeriesDataset
plot(*args, **kwargs)
plot
Plot a TimeSeriesDataset
copy([deep])
copy
Copy a TimeSeriesDataset
split_at(timestamp)
split_at
Split a TimeSeriesDataset at a defined point and include the splitting point in both as in [start,…,at] and [at,…,end].
split_in_chunks(n)
split_in_chunks
The TimeSeries in the TimeSeriesDataset are cut into chunks of length n
fill(value)
fill
Fill all values in each TimeSeries from a TimeSeriesDataset.
empty()
empty
Empty the values in each TimeSeries from a TimeSeriesDataset.
pad(limit[, side, value])
pad
Pad a TimeSeriesDataset until a given limit
trim([side])
trim
Remove NaNs from a TimeSeries start, end or both
merge(tsd)
merge
Merge two TimeSeriesDataset by the index of the TimeSeries
merge_by_label(tsd)
merge_by_label
Merge two TimeSeriesDatasets by the label of the TimeSeries in the TimeSeriesDatasets
select_components_randomly(n[, seed, indices])
select_components_randomly
Returns a subset of the TimeSeriesDataset with randomly chosen n elements without replacement.
select_components_by_percentage(percent[, …])
select_components_by_percentage
Returns a subset of the TimeSeriesDataset with randomly chosen percentage elements without replacement.
shuffle([inplace])
shuffle
Randomizing the order of the TS in the TSD
apply(func[, tsd])
apply
Apply function specialized for TimeSeriesDataset
resample(freq[, method])
resample
Convert the TimeSeries in a TimeSeriesDataset to a specified frequency.
group_by(freq[, method])
group_by
Groups values by a frequency for each TimeSeries in a TimeSeriesDataset.
interpolate(*args, **kwargs)
interpolate
Wrapper around the Pandas interpolate() method.
normalize(method)
normalize
Normalize the TimeSeries in a TimeSeriesDataset with a given method
round(decimals)
round
Round the values of every TimeSeries in the TimeSeriesDataset with a defined number of digits
sort(*args, **kwargs)
sort
Sort the TimeSeries of a TimeSeriesDataset by time stamps
regularize([side, fill])
regularize
Regularize a TimeSeriesDataset so that all starting and ending timestamps are similar.
min()
min
Minimum of all TimeSeries in TimeSeriesDataset
max()
max
Maximum of all TimeSeries in TimeSeriesDataset
mean()
mean
Means of all TimeSeries in TimeSeriesDataset
median()
median
Median of all TimeSeries in TimeSeriesDataset
skewness()
skewness
Skewness of all TimeSeries in TimeSeriesDataset
kurtosis()
kurtosis
Kurtosis of all TimeSeries in TimeSeriesDataset
describe()
describe
Describe a TimeSeriesDataset with the describe function from Pandas
start()
start
Get the first Timestamp of a all components of a TimeSeriesDataset
end()
end
Get the last Timestamp of a all components of a TimeSeriesDataset
boundaries()
boundaries
Get the tuple with the TimeSeries first and last index for all components in the TimeSeriesDataset
frequency()
frequency
Get the frequency of a each TimeSeries in a TimeSeriesDataset
duration()
duration
Get the duration for all TimeSeries in a TimeSeriesDataset
to_text(path)
to_text
Export a TimeSeriesDataset to text format
to_pickle(path)
to_pickle
Creating a pickle out of the TimeSeriesDataset
to_array()
to_array
TimeSeriesData to NumpyArray [n x len(tsd)], where n is number of
to_df()
to_df
Converts a TimeSeriesDataset to a Pandas DataFrame