Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Series.from_csv not loading header names #10483
Conversation
jreback
commented on an outdated diff
Jul 1, 2015
jreback
added Bug CSV
labels
Jul 1, 2015
jreback
added this to the
0.17.0
milestone
Jul 1, 2015
|
looks good pls add a whatsnew note in bug-fixes (for 0.17.0) |
|
Hopefully this worked, still new to git! |
|
I think this is ready to be merged if everything looks ok? |
jreback
added a commit
that referenced
this pull request
Jul 7, 2015
|
|
richlewis42 + jreback |
3382e12
|
|
merged via 3382e12 thanks! |
jreback
closed this
Jul 7, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
richlewis42 commentedJul 1, 2015
Series.from_csv at the moment does not load the series.name and series.index.name when the header keyword argument is stated.
This was introduced in 6078fba. The issue was that
Series.from_csvusesDataFrame.from_csv, which automatically indexes columns (in practice, the index column gets labelled 0 and the values column gets labelled 1). Converting this to a series will then cause theseries.nameto be 1, and theseries.index.nameto be 0. The fix was to explicitly set the names in Series.from_csv toNone.This caused the headers to be deleted even if they were provided by setting the header kwarg.
The fix is simple, to check if the headers are provided, and only setting the names to None if they are not.
I included some tests, please let me know if this is enough as I am new to open-source and pandas.
Thanks!