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

DOC: header='infer' is not working when there is no header, closes #17473 #18042

Merged
merged 7 commits into from
Nov 30, 2017

Conversation

cmazzullo
Copy link
Contributor

@jreback jreback changed the title Gh 17483 DOC: header='infer' is not working when there is no header, closes #17473 Oct 31, 2017
@jreback jreback added Docs IO CSV read_csv, to_csv labels Oct 31, 2017
passed the behavior is identical to ``header=0`` and column names
are inferred from the first line of the file, if column names are
passed explicitly then the behavior is identical to
``header=None``. Explicitly pass ``header=0`` to be able to replace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put a paragraph break here, its pretty long.

are passed the behavior is identical to ``header=0`` and column
names are inferred from the first line of the file, if column
names are passed explicitly then the behavior is identical to
``header=None``. Explicitly pass ``header=0`` to be able to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add a note in Handling Column Names, maybe a ::note box would be nice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make this note the same as above?

@codecov
Copy link

codecov bot commented Oct 31, 2017

Codecov Report

Merging #18042 into master will decrease coverage by 0.11%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18042      +/-   ##
==========================================
- Coverage   91.45%   91.33%   -0.12%     
==========================================
  Files         157      164       +7     
  Lines       51378    49802    -1576     
==========================================
- Hits        46987    45487    -1500     
+ Misses       4391     4315      -76
Flag Coverage Δ
#multiple 89.13% <ø> (-0.17%) ⬇️
#single 40.81% <ø> (+0.13%) ⬆️
Impacted Files Coverage Δ
pandas/io/parsers.py 95.59% <ø> (ø) ⬆️
pandas/core/computation/expressions.py 0% <0%> (-94.96%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/io/msgpack/_version.py 44.65% <0%> (-55.35%) ⬇️
pandas/core/frame.py 97.81% <0%> (-0.1%) ⬇️
pandas/core/window.py 96.37% <0%> (ø) ⬆️
pandas/tests/indexes/timedeltas/__init__.py 92.3% <0%> (ø)
pandas/tests/util/__init__.py 100% <0%> (ø)
pandas/tests/plotting/__init__.py 100% <0%> (ø)
pandas/tests/io/json/__init__.py 100% <0%> (ø)
... and 6 more

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 c40c8f8...04ee499. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Nov 2, 2017

@jorisvandenbossche if you'd review

@jreback jreback added this to the 0.21.1 milestone Nov 2, 2017
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Added two small comments

Default behavior is to infer the column names: if no names are
passed the behavior is identical to ``header=0`` and column names
are inferred from the first line of the file, if column names are
passed explicitly then the behavior is identical to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add: passed explicitly with the header keyword

``header=None``.

Explicitly pass ``header=0`` to be able to replace existing
names. The header can be a list of ints that specify row locations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make the paragraph break here at "The header can be ..." and leave the first sentence at the previou paragraph.

@jreback
Copy link
Contributor

jreback commented Nov 25, 2017

can you rebase

@cmazzullo
Copy link
Contributor Author

Sure thing @jreback

@jorisvandenbossche
Copy link
Member

@cmazzullo Seems something went wrong with the rebase (many commits included on github now). In principle if you do exactly the following (assuming pandas-dev/pandas remote is called upstream):

git fetch upstream
git checkout gh-17483
git rebase upstream/master
git push origin gh-17483 --force

this should solve it.

@jorisvandenbossche jorisvandenbossche merged commit 67c4d0f into pandas-dev:master Nov 30, 2017
@jorisvandenbossche
Copy link
Member

@cmazzullo quickly did the rebase myself. Thanks for this clarification of the docs!

@cmazzullo
Copy link
Contributor Author

Thanks!

TomAugspurger pushed a commit to TomAugspurger/pandas that referenced this pull request Dec 8, 2017
TomAugspurger pushed a commit that referenced this pull request Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs IO CSV read_csv, to_csv
Projects
None yet
Development

Successfully merging this pull request may close these issues.

header='infer' is not working when there is no header
4 participants