-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REGR: read_csv raising when dtypes is specified with usecols #54881
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
Conversation
pandas/io/parsers/python_parser.py
Outdated
@@ -1176,7 +1176,7 @@ def _set_no_thousand_columns(self) -> set[int]: | |||
) | |||
if self.columns and self.dtype: | |||
assert self._col_indices is not None | |||
for i in self._col_indices: | |||
for i, idx in enumerate(self._col_indices): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for i, idx in enumerate(self._col_indices): | |
for i, col in zip(self._col_indices, self.columns): |
and then self.columns[i]
can just be replaced with col
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep thx
Thanks @phofl |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
…dev#54881) * REGR: read_csv raising when dtypes is specified with usecols * Update * Add whatsnew (cherry picked from commit 75781c2)
…s is specified with usecols) (#54926)
…dev#54881) * REGR: read_csv raising when dtypes is specified with usecols * Update * Add whatsnew
IndexError: list index out of range
when usingdtype
andusecols
parameters #54868 (Replace xxxx with the GitHub issue number)doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.