TidyData
|
Container for tidy-form tabular data, allowing simple access to standardized and/or transformed values. |
Methods
Converts to WideData |
Attributes
Transformed data values. |
|
Standardized data values. |
|
|
|
|
- class gumbi.aggregation.TidyData(df: DataFrame, outputs: list, log_vars: list | None = None, logit_vars: list | None = None, names_column: str = 'Variable', values_column: str = 'Value', stdzr: Standardizer | None = None)
Bases:
MetaFrame
Container for tidy-form tabular data, allowing simple access to standardized and/or transformed values.
Note that
TidyData
is instantiated with a wide-form dataframe. This class is not intended to be instantiated directly, useDataSet
instead.TidyData
subclasses pandas’ DataFrame, which everyone says is a bad idea, so be prepared for unexpected behavior if instantiated directly. Namely, in-place modifications return aTidyData
type correctly, but slices return a pd.DataFrame type.- Parameters:
data (pd.DataFrame) – A wide-form dataframe.
outputs (list) – Columns of data to be treated as outputs.
names_column (str, default 'Variable') – Name to be used in tidy view for column containing output names.
values_column (str, default 'Value') – Name to be used in tidy view for column containing output values.
log_vars (list, optional) – List of input and output variables to be treated as log-normal. Ignored if stdzr is supplied.
logit_vars (list, optional) – List of input and output variables to be treated as logit-normal. Ignored if stdzr is supplied.
stdzr (Standardizer, optional) – An
Standardizer
instance. If not supplied, one will be created automatically.
- property t: DataFrame
Transformed data values.
- property z: DataFrame
Standardized data values.