New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
separator
parameter in pivot()
has no effect
#15775
Labels
Comments
jsarbach
added
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
python
Related to Python Polars
labels
Apr 19, 2024
MarcoGorelli
added
documentation
Improvements or additions to documentation
and removed
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
labels
Apr 20, 2024
hey - the separator is used if there are multiple |
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 │
# └─────┴──────┴──────┘ |
Ok :-) |
This was referenced Apr 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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
The text was updated successfully, but these errors were encountered: