-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
read_csv: chunksize clashes with nrows #6774
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
Comments
I think easiest ATM to simply raise NotImplementedError if both Implemented is a bit non-trivial but would be useful I agree. You want to do a PR for the NotImplementedError? Then we'll create an issue to implement this at some point. |
I would like to but find io/parsers.py quite confusing.
449 read_csv = _make_parser_function('read_csv', sep=',')
450 read_csv = Appender(_read_csv_doc)(read_csv)
|
…hunksize. For read_csv() the user intention most likely is to get a TextFileReader, when using the chunksize option, but simultaneous use of nrows is not implemented yet. This raises now a NotImplementedError. Test and entry to current whatsnew source (v0.14.1.txt) added. Fixes pandas-dev#6774
Is there a workaround for this issue? I am trying to pass in different parameters for testing and production. Testing: chunksize=None, nrows=n Production works fine, but when I try to implement the testing version, I receive the same error as others: NotImplementedError: 'nrows' and 'chunksize' cannot be used together yet. **Edit: I ended up utilizing a conditional statement and added a parameter for version type. |
If nrows are determined, the use of chunksize option does not create a TextFileReader object.
My suggestion:
I would find it useful to get chunks of x size, but only for the first n row of a huge file.
The text was updated successfully, but these errors were encountered: