Skip to content
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

BUG: 'Unnamed' != unnamed column in CSV #23687

Merged
merged 1 commit into from Nov 16, 2018

Conversation

Projects
None yet
3 participants
@gfyoung
Copy link
Member

commented Nov 14, 2018

False criterion was causing errors when specified headers appeared to capture
a seemingly unnamed row, just because they had the string "Unnamed" in it.

Setup:

from pandas import read_csv
from pandas.compat import StringIO

data = "Unnamed,NotUnnamed\n0,1\n2,3\n4,5"
read_csv(StringIO(data), header=[0, 1])

Previously, this would error:

...
ValueError : Passed header=[0,1] are too many rows for this multi_index of columns

Now, it nicely returns a DataFrame:

  Unnamed NotUnnamed
        0          1
0       2          3
1       4          5

Leverages the patch used in #23484 of self.unnamed_cols.

@pep8speaks

This comment has been minimized.

Copy link

commented Nov 14, 2018

Hello @gfyoung! Thanks for submitting the PR.

@gfyoung gfyoung force-pushed the forking-repos:unnamed-unrobust-criterion branch from ec41e07 to 7bcca7b Nov 14, 2018

@gfyoung gfyoung added this to the 0.24.0 milestone Nov 14, 2018

@codecov

This comment has been minimized.

Copy link

commented Nov 14, 2018

Codecov Report

Merging #23687 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #23687      +/-   ##
==========================================
- Coverage   92.25%   92.25%   -0.01%     
==========================================
  Files         161      161              
  Lines       51383    51381       -2     
==========================================
- Hits        47404    47402       -2     
  Misses       3979     3979
Flag Coverage Δ
#multiple 90.64% <100%> (-0.01%) ⬇️
#single 42.32% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/parsers.py 95.54% <100%> (-0.01%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a23f901...ff68dbd. Read the comment docs.

@gfyoung gfyoung force-pushed the forking-repos:unnamed-unrobust-criterion branch from 7bcca7b to 8e92e4c Nov 14, 2018

@gfyoung

This comment has been minimized.

Copy link
Member Author

commented Nov 14, 2018

@jreback : Address the comment, and all is still green. PTAL.

@jreback

This comment has been minimized.

Copy link
Contributor

commented Nov 14, 2018

conflict in the whatsnew, can you merge master

@gfyoung gfyoung force-pushed the forking-repos:unnamed-unrobust-criterion branch from 8e92e4c to 52cc5c9 Nov 14, 2018

@gfyoung

This comment has been minimized.

Copy link
Member Author

commented Nov 15, 2018

@jreback : Rebased my changes, and all is green. PTAL.

Show resolved Hide resolved pandas/io/parsers.py Outdated
BUG: 'Unnamed' != unnamed column in CSV
False criterion was causing errors when
specified headers appeared to capture
a seemingly unnamed row, just because
they had the string "Unnamed" in it.

@gfyoung gfyoung force-pushed the forking-repos:unnamed-unrobust-criterion branch from 52cc5c9 to ff68dbd Nov 15, 2018

@gfyoung

This comment has been minimized.

Copy link
Member Author

commented Nov 15, 2018

@jreback : Addressed all comments, all is still green. PTAL.

@jreback jreback merged commit 4a6a918 into pandas-dev:master Nov 16, 2018

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
pandas-dev.pandas Build #20181115.51 succeeded
Details
@jreback

This comment has been minimized.

Copy link
Contributor

commented Nov 16, 2018

thanks!

@gfyoung gfyoung deleted the forking-repos:unnamed-unrobust-criterion branch Nov 16, 2018

brute4s99 added a commit to brute4s99/pandas that referenced this pull request Nov 19, 2018

BUG: 'Unnamed' != unnamed column in CSV (pandas-dev#23687)
False criterion was causing errors when
specified headers appeared to capture
a seemingly unnamed row, just because
they had the string "Unnamed" in it.

Pingviinituutti added a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019

BUG: 'Unnamed' != unnamed column in CSV (pandas-dev#23687)
False criterion was causing errors when
specified headers appeared to capture
a seemingly unnamed row, just because
they had the string "Unnamed" in it.

Pingviinituutti added a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019

BUG: 'Unnamed' != unnamed column in CSV (pandas-dev#23687)
False criterion was causing errors when
specified headers appeared to capture
a seemingly unnamed row, just because
they had the string "Unnamed" in it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.