-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Constructing Series with dtype pl.List(pl.Float32) rounds inputs to integers #9500
Comments
If yes, how can I avoid that? |
You can specify the dtype while creating it: x = pl.Series([[1,2],[2.6,3],[3,4,4.4]], dtype=pl.List(pl.Float32)) |
would your expected outcome be that |
@ion-elgreco that doesn't work for me. I still get all ints. |
My output is a little different - it does get cast to float, but after first reading as an integer, it seems: >>> import polars as pl
>>> pl.Series([[1,2],[2.6,3],[3,4,4.4]], dtype=pl.List(pl.Float32))
shape: (3,)
Series: '' [list[f32]]
[
[1.0, 2.0]
[2.0, 3.0]
[3.0, 4.0, 4.0]
]
>>> pl.__version__
'0.18.1' I would say it's a bug. |
My bad, I glanced over the printed result. Indeed, it's returning still integers, as @avimallu also shows. |
how to convert label of this issue to bug from question? |
Duplicate of #11009, which has now been accepted. |
Closing in favor of #11156 |
Research
I have searched the above polars tags on Stack Overflow for similar questions.
I have asked my usage related question on Stack Overflow.
Link to question on Stack Overflow
No response
Question about Polars
I am using '0.18.3' version of polars and seeing below problem:
shape: (3,)
Series: '' [list[i64]]
[
[1, 2]
[2, 3]
[3, 4, 4]
]
it has converted the float number to int without any warning or error. it this expected?
The text was updated successfully, but these errors were encountered: