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
list.sum()
import polars as pl df = pl.DataFrame({"a": [[1, 2]]}) df.with_columns(sum = pl.when(True).then(pl.col("a").list.sum())) # shape: (1, 2) # ┌───────────┬───────────┐ # │ a ┆ sum │ # │ --- ┆ --- │ # │ list[i64] ┆ list[i64] │ # ╞═══════════╪═══════════╡ # │ [1, 2] ┆ [3] │ # └───────────┴───────────┘
No response
Taken from https://stackoverflow.com/questions/78525956/odd-result-from-list-sum-possible-issue
list.sum() inside a WhenThen expression now returns a list.
Return a number.
--------Version info--------- Polars: 0.20.29 Index type: UInt32 Platform: macOS-13.6.1-arm64-arm-64bit Python: 3.12.2 (main, Feb 6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)] ----Optional dependencies---- adbc_driver_manager: <not installed> cloudpickle: <not installed> connectorx: <not installed> deltalake: <not installed> fastexcel: <not installed> fsspec: <not installed> gevent: <not installed> hvplot: <not installed> matplotlib: <not installed> nest_asyncio: <not installed> numpy: 1.26.4 openpyxl: <not installed> pandas: 2.2.1 pyarrow: 15.0.2 pydantic: <not installed> pyiceberg: <not installed> pyxlsb: <not installed> sqlalchemy: <not installed> xlsx2csv: <not installed> xlsxwriter: <not installed>
The text was updated successfully, but these errors were encountered:
Can't reproduce on 0.20.23, but can on 0.20.28, a relatively recent regression.
Sorry, something went wrong.
ritchie46
Successfully merging a pull request may close this issue.
Checks
Reproducible example
Log output
No response
Issue description
Taken from https://stackoverflow.com/questions/78525956/odd-result-from-list-sum-possible-issue
list.sum()
inside a WhenThen expression now returns a list.Expected behavior
Return a number.
Installed versions
The text was updated successfully, but these errors were encountered: