Pandas accessors#
Continuous timeseries also provides a pandas accessor.
For details of the implementation of this pattern, see
pandas' docs.
The accessors must be registered before they can be used
(we do this to avoid imports of any of our modules having side effects,
which is a pattern we have had bad experiences with in the past).
This is done with
register_pandas_accessor,
By default, the accessors are provided under the "ct" namespace
and this is how the accessors are documented below.
However, the namespace can be customised when using
register_pandas_accessor,
should you wish to use a different namespace for the accessor.
For the avoidance of doubt, in order to register/activate the accessors, you will need to run something like:
from continuous_timeseries.pandas_accessors import register_pandas_accessor
# The 'pd.Series.ct' namespace will not be available at this point.
# Register the accessors
register_pandas_accessor()
# The 'pd.Series.ct' namespace
# (or whatever other custom namespace you chose to register)
# will now be available.
The full accessor API is documented below.
pd.Series.ct #
pd.Series accessors
For details, see pandas' docs.
Attributes:
| Name | Type | Description |
|---|---|---|
pd.Series.ct.metadata |
DataFrame
|
Get the metadata as a |
Source code in src/continuous_timeseries/pandas_accessors.py
pd.Series.ct.metadata
property
#
pd.Series.ct.metadata: DataFrame
Get the metadata as a pd.DataFrame