polars.Expr.name.suffix_fields#

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

Add a suffix to all fields name of a struct.

Parameters:
suffix

Suffix to add to the filed name

Notes

This only take effects for struct.

Examples

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