-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: RangeIndex as default index #19781
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
pandas/core/frame.py
Outdated
no indexing information part of input data and no index provided | ||
columns : Index or array-like | ||
Column labels to use for resulting frame. Will default to | ||
np.arange(n) if no column labels are provided | ||
RangeIndex if no column labels are provided |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can u check Series doc string as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Series is good already
@@ -251,11 +251,11 @@ class DataFrame(NDFrame): | |||
data : numpy ndarray (structured or homogeneous), dict, or DataFrame | |||
Dict can contain Series, arrays, constants, or list-like objects | |||
index : Index or array-like | |||
Index to use for resulting frame. Will default to np.arange(n) if | |||
Index to use for resulting frame. Will default to RangeIndex if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think many people are not that familiar with the concept of "RangeIndex". Therefore, maybe we can leave the origin arange(n) after it between brackets? Or something like "RangeIndex (values 0, 1, 2, ..., n)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do RangeIndex (0, 1, 2, ..., n)
?
Some may not know arange(n)
either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxim-lian your suggestion looks good. pls ping when ready. (and update Series to similar)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was indeed a good suggestion!
Codecov Report
@@ Coverage Diff @@
## master #19781 +/- ##
==========================================
- Coverage 91.61% 91.6% -0.01%
==========================================
Files 150 150
Lines 48887 48887
==========================================
- Hits 44786 44784 -2
- Misses 4101 4103 +2
Continue to review full report at Codecov.
|
Unrelated test failures: https://travis-ci.org/maxim-lian/pandas/jobs/344592059 |
thanks! |
Small correction to DataFrame docstring