eta_nexus.subscription_handlers.df_subscription_handler module
- class eta_nexus.subscription_handlers.df_subscription_handler.DFSubscriptionHandler(write_interval: TimeStep = 1, size_limit: int = 100, *, auto_fillna: bool = True)[source]
Bases:
SubscriptionHandlerSubscription handler for returning pandas.DataFrames when requested.
- Parameters:
write_interval – Interval between index values in the data frame (value to which time is rounded).
size_limit – Number of rows to keep in memory.
auto_fillna – If True, missing values in self._data are filled with the pandas-method df.ffill() each time self.data is called.
- push(node: Node, value: Any | pd.Series | Sequence[Any], timestamp: datetime | pd.DatetimeIndex | TimeStep | None = None) None[source]
Append values to the dataframe.
- Parameters:
node – Node object the data belongs to.
value – Value of the data or Series of values. There must be corresponding timestamps for each value.
timestamp – Timestamp of receiving the data or DatetimeIndex if pushing multiple values. Alternatively an integer/timedelta can be provided to determine the interval between data points. Use negative numbers to describe past data. Integers are interpreted as seconds. If value is a pd.Series and has a pd.DatetimeIndex, timestamp is ignored.
- get_latest() pd.DataFrame | None[source]
Return a copy of the dataframe, this ensures they can be worked on freely. Returns None if data is empty.
- property data: pandas.DataFrame
This contains the interval dataframe and will return a copy of that.