polars.Expr.name.suffix_fields#

Expr.name.suffix_fields(suffix: str) Expr[source]#

Add a suffix to all field names of a struct.

Parameters:
suffix

Suffix to add to the field name.

Notes

This only takes effect for struct columns.

Examples

>>> df = pl.DataFrame({"x": {"a": 1, "b": 2}})
>>> df.select(pl.col("x").name.suffix_fields("_suffix")).schema
Schema({'x': Struct({'a_suffix': Int64, 'b_suffix': Int64})})