panel_aware_suffix¶
yohou.utils.panel.panel_aware_suffix(col, suffix)
¶
Add a suffix to a column name while preserving the panel group prefix.
For panel data columns (<GROUP>__<SERIES>), the suffix is appended
to the series part: <GROUP>__<SERIES>_<SUFFIX>.
For global columns, the suffix is appended: <COLUMN>_<SUFFIX>.
Parameters¶
| Name | Type | Description | Default |
|---|---|---|---|
col
|
str
|
Column name to suffix. |
required |
suffix
|
str
|
Suffix string to add (joined with |
required |
Returns¶
| Type | Description |
|---|---|
str
|
Column name with suffix added. |
Examples¶
>>> panel_aware_suffix("sales", "lag_1")
'sales_lag_1'
>>> panel_aware_suffix("store_1__sales", "lag_1")
'store_1__sales_lag_1'
See Also¶
panel_aware_rename: General-purpose panel-aware rename utility.