Closed jsarbach closed 1 month ago
hey - the separator is used if there are multiple values
Ah I see, thanks for clarifying.
@jsarbach fancy updating the document about this?
Are there any plans to allow expressions?
i.e.
df.pivot(
index="ix"
columns=pl.format("{}_{}", "col1", "col2"),
values="val"
)
In order to:
(df.with_columns(columns=pl.format("{}_{}", "col1", "col2"))
.pivot(index="ix", columns="columns", values="val")
)
# shape: (2, 3)
# ┌─────┬──────┬──────┐
# │ ix ┆ a_1 ┆ b_2 │
# │ --- ┆ --- ┆ --- │
# │ i64 ┆ i64 ┆ i64 │
# ╞═════╪══════╪══════╡
# │ 0 ┆ 1 ┆ null │
# │ 1 ┆ null ┆ 2 │
# └─────┴──────┴──────┘
@jsarbach fancy updating the document about this?
Ok :-)
Checks
Reproducible example
Log output
Issue description
According to the documentation,
separator
is used as separator/delimiter in generated column names. However, it seems to be ignored (incl. the default_
).Expected behavior
Installed versions