Skip to content

BUG in read_csv skipping a row after a row with trailing spaces #8983

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

Closed
selasley opened this issue Dec 3, 2014 · 0 comments · Fixed by #8984
Closed

BUG in read_csv skipping a row after a row with trailing spaces #8983

selasley opened this issue Dec 3, 2014 · 0 comments · Fixed by #8984
Labels
Bug IO CSV read_csv, to_csv
Milestone

Comments

@selasley
Copy link
Contributor

selasley commented Dec 3, 2014

as reported by @xdliao in #8752, skipping a row after a row with trailing spaces fails to create the expected dataframe
data = """A B C \nD E F \nH I J \n1 2 3 \n4 5 6 \n"""
pd.read_csv(StringIO(data), skiprows=2, delim_whitespace=True) and
pd.read_csv(StringIO(data), skiprows=[0,1], delim_whitespace=True) work as expected, but the dataframes returned by
pd.read_csv(StringIO(data), skiprows=[0,2], delim_whitespace=True) and
pd.read_csv(StringIO(data), skiprows=[1,2], delim_whitespace=True) are incorrect

@jreback jreback added Community Bug IO CSV read_csv, to_csv and removed Community labels Dec 3, 2014
@jreback jreback added this to the 0.15.2 milestone Dec 3, 2014
jreback added a commit that referenced this issue Dec 3, 2014
BUG in read_csv skipping rows after a row with trailing spaces, #8983
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO CSV read_csv, to_csv
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants