ds_provider_unimicro_py_lib.utils.dataframe¶
File: dataframe.py
Region: ds_provider_unimicro_py_lib/utils/dataframe
Helpers for shaping dataset output frames.
Functions¶
|
Restrict the output to |
Module Contents¶
- ds_provider_unimicro_py_lib.utils.dataframe.project_fields(output: pandas.DataFrame, fields: list[str] | None) pandas.DataFrame[source]¶
Restrict the output to
fields(ignoring names that are not present), if configured.- Parameters:
output – The normalized output dataframe.
fields – Column names to keep, in the requested order.
Noneor empty keeps everything.
- Returns:
The projected dataframe, or the input unchanged when
fieldsis not set. If none of the requested fields exist, an empty frame with the same index is returned.- Return type:
pd.DataFrame