Comments (5)
May I request that this ticket be reopened. pyexcel is actually in control here, in the sense that it is doing an extra number coercion step beyond what the builtin csv
module is doing. That extra step is preventing people like me and @doudz, who need to work with decimal commas, from reading the numbers correctly. Consider the following CSV:
"2023-07-29";"0,02"
If I do this:
import csv
with open('the-above-file.csv') as my_file:
print(next(csv.reader(my_file, delimiter=';')))
I get ('2023-07-29', '0,02')
as output. The second field is not interpreted, I can do a string replacement to replace the decimal comma by a decimal point.
However, if I do this:
import pyexcel
print(pyexcel.get_array(file_name='the-above-file.csv', delimiter=';')[0])
I get ['2023-07-29', 2]
. The second field has already been interpreted and the position of the decimal comma has been lost.
I can understand if you cannot or don't want to support decimal commas, but at least please give us a way to switch off automatic number coercion so we can address it ourselves. As it currently is, I have to revert to the standard csv
module.
from pyexcel.
@CodeWithOz I didn't use iget_records
. I'm fortunate enough that I only need to work with small spreadsheets.
from pyexcel.
that has to be with your data presentation. pyexcel or csv module are not in control.
from pyexcel.
Yes, I have converted float to string and then replace dot by comma
from pyexcel.
@jgonggrijp were you using pyexcel's iget_records
method? If so, how did you replace its functionalty with the standard csv
module? Asking because I'm using iget_records
for processing large files without loading them all into memory, so I need a solution that won't blow out my memory if I switch away from pyexcel.
from pyexcel.
Related Issues (20)
- How can I maintain column headers when adding all sheets to a book?
- Get cell indexes/coordinates
- deprecate old python versions HOT 1
- `file_name` argument supports `pathlib.Path`
- Add tqdm progressbar to BookStream and SheetStream [feature request]
- documentation: Output formats for p.save_as are not documented. HOT 1
- pyexcel assumes dest_file_name is a str, does not tolerate pathlib.Path
- append_doc method breaks with interpreter optimization on
- get_book() restults in TypeError: 'set' object is not subscriptable HOT 3
- Why is Chardet a dependency? HOT 3
- html getter is not defined HOT 1
- Replace deprecated imp module with importlib
- _csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
- save book after adding sheet not working
- Some information of a long text cell is not saved.
- Does not work with Python 3.12 (Windows 11, Office 365) HOT 1
- is slow load of .ods file expected/not planned to be fixed?
- Inconsistent result for formulas in string
- Auto Py To Exe fail to find hidden import package
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 pyexcel.