Comments (7)
Why do you think this should be convertible to a float? Looks like a bad input to me.
from polars.
I found this in a random CSV file that I wanted to parse. I guess it's a relatively rare but legitimate ("non-")character that's inserted by Excel/etc for number formatting
from polars.
Was it the first two bytes? FEFF
is the optional byte-order mark for BE Utf-16, and it's probably ending up in your CSV due to being exported with a specified encoding and byte order. I've had plenty of CSVs that get wonky due to this mark, and I usually open them and re-encode them as UTF-8 in Notepad++ or something similar.
I don't know if polars checks the byte order mark if it exists. Maybe it should, but if so that should be its own issue. But it doesn't seem to have caused many problems for people up until now.
from polars.
No, it was between two separators like this
transaction_id;amount
abcdef;-\ufeff42
from polars.
According to https://www.unicode.org/faq/utf_bom.html#bom6, that shouldn't be there at all. I'd do a replace prior to trying to do anything with that string.
from polars.
Hmm ok sounds like an actual bug in my data then.
The only annoying thing that remains a potential todo is to improve displaying of the character in the error message. Although not sure how to display it since it's a "zero width" character...
from polars.
Yeah this doesn't sound like something Polars should fix. Closing then!
from polars.
Related Issues (20)
- Data in csv files with less columns than schema shifts data. HOT 4
- Add the argument `ignore_nulls` in `.arr.all()`, `.arr.any()`, `.list.all()` and `.list.any()`
- read_database_uri panics for dates beyond 2262.04.11 HOT 2
- Move streaming engine original plan to separate field on the `IRPlan`
- Write upgrade guide for 1.0.0
- Polars is unable to parse dates beyond 2262.04.11 HOT 1
- Make a ParquetWriter context handler and/or more control over row group creation
- Casting to float32, int32, int16 and int8 in polars is slower than pandas in larger dfs HOT 4
- Interpolate based on other Float64 column HOT 3
- Comparing 0 with UInt64 values larger than Int64::MAX incorrectly return NULL
- `read_csv` ignores the `columns` parameter when reading an empty CSV file with header HOT 1
- Inconsistent XOR when using literals
- `pl.concat_str(...)`'s `ignore_nulls` arg field
- In `pl.read_csv(...)`, allow `separator=None` in order to read everything into only a single column HOT 1
- pl.DataFrame loads in 2D lists in unexpected way HOT 5
- `join_asof` breaks with certain parquet files (I think due to memory layout or something?) HOT 2
- Expressions result in different serializations across Python Polars PATCH version upgrades HOT 1
- Add inline XOR (`^`) operator for selectors HOT 3
- Inconsistency in constructing dataframes with timezone-aware datatypes HOT 8
- "Failed to determine supertype of bool and datetime[ns]" Panic
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polars.