Closed Julian-J-S closed 1 month ago
you can do like
pl.read_csv(source="decimal.csv", schema={"x": pl.Float64()})
┌─────┐
│ x │
│ --- │
│ f64 │
╞═════╡
│ 0.1 │
│ 0.2 │
you can do like
pl.read_csv(source="decimal.csv", schema={"x": pl.Float64()})
┌─────┐ │ x │ │ --- │ │ f64 │ ╞═════╡ │ 0.1 │ │ 0.2 │
How does that help? 🤔 Float and Decimal are very different types with different use cases. If I read as float I immediately get the imprecision that I want to avoid
How does that help? 🤔 Float and Decimal are very different types with different use cases. If I read as float I immediately get the imprecision that I want to avoid
Ah Sorry ... Yes it won't help you with precision
Description
Now that writing
Decimal
to csv withwrite_csv
is available (yeah! 🥳 ) I would love to see the same for reading 😄creates
but reading then fails
Ofc I can read as
str
and parse afterwards but converting while reading would be faster and more efficient 😃