TidyData

TidyData(df, outputs[, log_vars, ...])

Container for tidy-form tabular data, allowing simple access to standardized and/or transformed values.

Methods

TidyData.to_wide()

Converts to WideData

Attributes

TidyData.t

Transformed data values.

TidyData.z

Standardized data values.

TidyData.df

TidyData.outputs

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, use DataSet 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 a TidyData 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.

to_wide() WideData

Converts to WideData

property z: DataFrame

Standardized data values.