TimeSeries
TimeSeries(values, time_step, time_index=0)Time series data.
Args
- values (dict[str, Sequence[complex]]): Values in the time series as a dictionary mapping names to the sequence of values corresponding to consecutive time steps.
- time_step (float): Time step between consecutive values in the time series.
- time_index (int): Starting index of the time series. The time series starts at time
t = time_index * time_step.
Example
The time series data can be indexed by port name or time index:
>>> data = pf.TimeSeries(... {"P0@0": [0, 1, 2, 3], "T1": [-1, -2, -3]}, 1e-10, 5... )>>> data["T1"] # note missing values filled with zerosarray([-1.+0.j, -2.+0.j, -3.+0.j, 0.+0.j])>>> data[6] # time_index == 5, so index 6 means the 2nd value{'P0@0': (1+0j), 'T1': (-2+0j)}Methods
Section titled “Methods”| Method | Description |
|---|---|
copy | Create a copy of this time_series. |
copy(self)Create a copy of this time_series.
Returns
New copy.
Attributes
Section titled “Attributes”| Attribute | Description |
|---|---|
properties | Properties: Object properties. |
time_index | int: Starting index in the time series. |
time_step | float: Time step dt in the time series (read only). |
times | ndarray: Times in the time series (read only). |
values | dict[str, ndarray]: Values in the time series (read only). |
properties
Section titled “properties”Properties: Object properties.
time_index
Section titled “time_index”int: Starting index in the time series.
time_step
Section titled “time_step”float: Time step dt in the time series (read only).
ndarray: Times in the time series (read only).
values
Section titled “values”dict[str, ndarray]: Values in the time series (read only).