PandasRegistry.get_calc()

PandasRegistry.get_calc()#

PandasRegistry.get_calc(name, transform, var_name=None, cache_key=None)[source]#

Get a derived version of the variable.

Derived variables are cached when possible. Creates a lsl.new_obs for the base variable and a lsl.new_calc for the derived variable.

Parameters:
  • name (str) – Column name in the data frame

  • transform (Callable) – Callable transformation function to apply

  • var_name (str | None, default: None) – Custom name for the resulting variable

  • cache_key (str | None, default: None) – Explicit cache key. If provided, skips function hashing.

Return type:

Var

Returns:

liesel.Var object with transformed values