discontinuum.utils#
Data preprocessing utilities.
Functions
Aggregate data to daily values. |
|
|
Create a counterfactual by substituting data from an interval. |
- discontinuum.utils.aggregate_to_daily(ds: Dataset) Dataset #
Aggregate data to daily values.
- Parameters:
ds (Dataset) – Data to aggregate.
- Returns:
Daily aggregated data.
- Return type:
Dataset
- discontinuum.utils.time_substitution(ds: Dataset, interval: slice) Dataset #
Create a counterfactual by substituting data from an interval.
Takes the data interval and repreats it to fill the whole dataset. For the dataset [1, 2, 3, 4, 5], substitution(ds, slice(0, 0)) returns [1, 1, 1, 1, 1].
- Parameters:
ds (Dataset) – Data to substitute.
interval (slice) – Interval to substitute.
- Returns:
Data with substituted data.
- Return type:
Dataset