We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
df = pl.DataFrame( { "a": [1, 2, 1], "b": [{"a": 1}, {"a": 1}, {"a": 2}], "c": ["x", "y", "y"], "d": [1, 1, 3], } ) print(df.pivot(index=("b", "d"), values="a", columns="c"))
shape: (3, 4) ┌───────────┬─────┬──────┬──────┐ │ b ┆ d ┆ x ┆ y │ │ --- ┆ --- ┆ --- ┆ --- │ │ struct[1] ┆ i64 ┆ i64 ┆ i64 │ ╞═══════════╪═════╪══════╪══════╡ │ {null} ┆ 1 ┆ 1 ┆ null │ │ {null} ┆ 1 ┆ null ┆ 2 │ │ {null} ┆ 3 ┆ null ┆ 1 │ └───────────┴─────┴──────┴──────┘
Similar to #14101, but it goes down a different branch so I think it deserves a separate issue to make sure that both parts get addressed
I think it should be
shape: (2, 4) ┌──────────┬─────┬──────┬─────┐ │ b ┆ d ┆ x ┆ y │ │ --- ┆ --- ┆ --- ┆ --- │ │ struct[1]┆ i64 ┆ i64 ┆ i64 │ ╞══════════╪═════╪══════╪═════╡ │ {1} ┆ 1 ┆ 1 ┆ 2 │ │ {2} ┆ 3 ┆ null ┆ 1 │ └──────────┴─────┴──────┴─────┘
--------Version info--------- Polars: 0.20.7 Index type: UInt32 Platform: Linux-5.15.133.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 Python: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] ----Optional dependencies---- adbc_driver_manager: <not installed> cloudpickle: 3.0.0 connectorx: <not installed> deltalake: <not installed> fsspec: 2023.12.2 gevent: <not installed> hvplot: 0.9.1 matplotlib: 3.8.2 numpy: 1.26.3 openpyxl: <not installed> pandas: 2.2.0 pyarrow: 15.0.0 pydantic: <not installed> pyiceberg: <not installed> pyxlsb: <not installed> sqlalchemy: 2.0.25 xlsx2csv: <not installed> xlsxwriter: <not installed>``` </details>
The text was updated successfully, but these errors were encountered:
index
MarcoGorelli
Successfully merging a pull request may close this issue.
Checks
Reproducible example
Log output
Issue description
Similar to #14101, but it goes down a different branch so I think it deserves a separate issue to make sure that both parts get addressed
Expected behavior
I think it should be
Installed versions
The text was updated successfully, but these errors were encountered: