-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Update documentation of read_csv to explain that index_col can be a string containg a column name #25502
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
Conversation
…tring containg a column name.
Codecov Report
@@ Coverage Diff @@
## master #25502 +/- ##
=======================================
Coverage 91.75% 91.75%
=======================================
Files 173 173
Lines 52955 52955
=======================================
Hits 48589 48589
Misses 4366 4366
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #25502 +/- ##
==========================================
- Coverage 91.75% 91.25% -0.51%
==========================================
Files 173 172 -1
Lines 52955 52977 +22
==========================================
- Hits 48589 48342 -247
- Misses 4366 4635 +269
Continue to review full report at Codecov.
|
Remove description of columns used as indexes not also being present as normal columns in documentation for read_csv.
whitespace issue:
https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=9437
…On Thu, Mar 14, 2019 at 8:10 AM Jacob Bundgaard ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pandas/io/parsers.py
<#25502 (comment)>:
> @@ -102,11 +102,14 @@
List of column names to use. If file contains no header row, then you
should explicitly pass ``header=None``. Duplicates in this list will cause
a ``UserWarning`` to be issued.
-index_col : int, sequence or bool, optional
- Column to use as the row labels of the DataFrame. If a sequence is given, a
- MultiIndex is used. If you have a malformed file with delimiters at the end
- of each line, you might consider ``index_col=False`` to force pandas to
- not use the first column as the index (row names).
+index_col : int, str, sequence of int / str, or False, default ``None``
+ Column(s) to use as the row labels of the ``DataFrame``, either given as
+ string name or column index. If a sequence of int / str is given, a
+ MultiIndex is used. Columns used for the index (row names) are dropped from
+ the actual columns of the input dataframe. They are accessible via
+ ``.index``. (Note: ``index_col=False`` can be used to force pandas to *not*
Like this? (I'm not sure why this is duplicated across code comments and
documentation in the first place instead of being included from the code
when compiling the documentation, but if it's to be fixed, it should
probably be in another pull request.)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#25502 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIhZ-TsBxvM8nS56Oyv6ewcTJWsvOks5vWkpFgaJpZM4bY980>
.
|
Oops! I didn't notice that there's no spaces on the empty lines. It's fixed now. |
lgtm. unless anyone has comments. |
Remove description of columns used as indexes not also being present as normal columns in documentation for read_csv.
Thanks @kimsey0! |
Thanks for getting it merged. |
Uses the suggestion from #22276 and closes #22276.