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
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
>>> pl.Series([1,2,3]) @ pl.Series([4,5,6]) 32.0 >>> pl.Series([1,2,3]).dot(pl.Series([4,5,6])) 32.0
No response
The dot product of two integer series is a float when using either @ or dot.
@
dot
The dot product should be an integer.
--------Version info--------- Polars: 0.19.12 Index type: UInt32 Platform: Linux-4.4.0-22621-Microsoft-x86_64-with-glibc2.35 Python: 3.11.6 | packaged by conda-forge | (main, Oct 3 2023, 10:40:35) [GCC 12.3.0] ----Optional dependencies---- adbc_driver_sqlite: 0.7.0 cloudpickle: 3.0.0 connectorx: 0.3.2 deltalake: 0.10.1 fsspec: 2023.10.0 gevent: 23.9.1 matplotlib: 3.8.0 numpy: 1.26.1 openpyxl: 3.1.2 pandas: 2.1.2 pyarrow: 13.0.0 pydantic: 2.4.2 pyiceberg: 0.5.0 pyxlsb: 1.0.10 sqlalchemy: 2.0.22 xlsx2csv: 0.8.1 xlsxwriter: 3.1.9
The text was updated successfully, but these errors were encountered:
The same thing happens with pow, with the additional problem that string and boolean columns are also automatically cast to float:
pow
>>> pl.DataFrame({'a': [1, 2, 3], 'b': ['4', '5', '6'], 'c': [True, False, True]}).with_columns(pl.all() ** 2) a b c 1.0 16.0 1.0 4.0 25.0 0.0 9.0 36.0 1.0 shape: (3, 3) >>> pl.DataFrame({'a': [1, 2, 3], 'b': ['4', '5', '6'], 'c': [True, False, True]}).with_columns(pl.all().pow(2)) a b c 1.0 16.0 1.0 4.0 25.0 0.0 9.0 36.0 1.0 shape: (3, 3)
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Reproducible example
Log output
No response
Issue description
The dot product of two integer series is a float when using either
@
ordot
.Expected behavior
The dot product should be an integer.
Installed versions
The text was updated successfully, but these errors were encountered: