format_header
format_header(
result,
header,
delim='\n',
include_header_name=True,
include_header_key=True,
)Pivot result so header columns become column headers; estimate_value becomes cells.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| result | DataFrame | Must contain estimate_value. Header columns must be in result. | required |
| header | list of str | Column names to build headers from (order = hierarchy). | required |
| delim | str | Delimiter in generated header labels. | '\n' |
| include_header_name | bool | Include the key name (e.g. “Study strata”) in the header text. | True |
| include_header_key | bool | Include [header], [header_level] etc. in the label (for downstream styling). | True |
Returns
| Name | Type | Description |
|---|---|---|
| DataFrame | Pivoted table with new column names from header levels. |