- ctdfjorder.CTD.CTD.get_df(self, pandas=False) DataFrame | Any#
Returns the dataframe of the CTD object for integration with custom pipelines.
- Parameters:
pandas (bool, default False) – If True returns a pandas df, if False returns a polars DataFrame. Defaults to False.
Examples
Accessing CTD data as a polars dataframe .. code-block:: python
from ctdfjorder import CTD ctd_data = CTD(‘CC1531002_20181225_114931.csv’) ctd_data.remove_non_positive_samples() output = ctd_data.get_df() print(output.head(3))
Accessing CTD data as a pandas dataframe .. code-block:: python
from ctdfjorder import CTD ctd_data = CTD(‘CC1531002_20181225_114931.csv’) ctd_data.remove_non_positive_samples() output = ctd_data.get_df(pandas=True) print(output.head(3))
- Returns:
CTD data in pandas when pandas=True, polars when pandas=False.
- Return type:
pl.DataFrame | pd.DataFrame
Notes
There is no supported method to reinsert the dataframe back into the
CTDobject. Any changes made on this dataframe will not be reflected in theCTDobjects internal data.