Skip to content

Commit

Permalink
raise ValueError if usecols has same size as but doesn't exist in hea…
Browse files Browse the repository at this point in the history
…ders (#14671)
  • Loading branch information
GGordonGordon committed Nov 17, 2016
1 parent 726efc7 commit a5d344b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pandas/io/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ def __init__(self, src, **kwds):
self.orig_names = self.names[:]

if self.usecols:
if len(self.names) > len(self.usecols):
if len(self.names) >= len(self.usecols):
self.names = [n for i, n in enumerate(self.names)
if (i in self.usecols or n in self.usecols)]

Expand Down

0 comments on commit a5d344b

Please sign in to comment.