-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
read_csv arguments: can we have skipcols and userows? #15799
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
this is essentially a duplicate of the now closed: #10882
in a similar vein, The defaults make the most sense here, e.g. generally you want to keep columns (out of a larger set) and skip (a small subset of rows). I am not anti the counter parts, but this is just one more keyword and added complexity. |
Yep, I'm in agreement with @jreback here. Especially since we can accept callables for both inputs you can emulate skipcols = [...]
userows = [...]
read_csv(..., usecols=lambda x: x not in skipcols,
skiprows=lambda x: x not in userows]) I think this should resolve your concern about "clunkiness" as you put it, so if there are no other concerns, I think this is safe to close. |
This feature is in 0.20.0 which is not released yet, docs are in the dev-docs: http://pandas-docs.github.io/pandas-docs-travis/generated/pandas.read_csv.html?highlight=read_csv#pandas.read_csv |
Is there a reason why
read_csv
has ausecols
andskiprows
as arguments, but notskipcols
anduserows
? Is this to avoid parameter checks or something more fundamental than that?It would be nice to have all four options to avoid clunky inversions of the type
usecols = columns.remove(unwanted_col)
.The text was updated successfully, but these errors were encountered: