Skip to content

Commit

Permalink
Continue to fix #641
Browse files Browse the repository at this point in the history
  • Loading branch information
rainwoodman committed Sep 8, 2020
1 parent d9f7bf0 commit 020294c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nbodykit/io/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ def verify_data(path, names, nrows=10, **config):
try:
# first check no columns are missing to avoid silent data loss:
# https://github.com/pandas-dev/pandas/issues/26218
df = read_csv(path, nrows=nrows, **config)
config_without_usecols = {}
config_without_usecols.update(config)
config_without_usecols.pop('usecols', None)
df = read_csv(path, nrows=nrows, **config_without_usecols)
if len(df.columns) != len(names):
raise ValueError("Number of columns does not match, excepting len(names) == %d" % len(df.columns))

Expand Down

0 comments on commit 020294c

Please sign in to comment.