-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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 add example of DataFrame.index #52835
Conversation
DOC add example of DataFrame.index
pandas/core/frame.py
Outdated
See Also | ||
-------- | ||
DataFrame.columns : The column labels of the DataFrame. | ||
DataFrame.values : Return a Numpy representation of the DataFrame. |
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.
Please don't add this, we generally recommend to_numpy instead of values
pandas/core/frame.py
Outdated
In this example, we create a DataFrame with 3 rows and 3 columns, | ||
including Name, Age, and Location information. We set the index labels to | ||
be the integers 10, 20, and 30. We then access the `index` attribute of the | ||
DataFrame, which returns an `Int64Index` object containing the index labels. |
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.
Int64Index
was removed in 2.0, this is a regular Index
now
pandas/core/frame.py
Outdated
|
||
In this example, we modify the index labels of the DataFrame by assigning | ||
a new list of labels to the `index` attribute. The DataFrame is then | ||
reindexed with the new labels, and the output shows the modified DataFrame. |
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.
reindexed
is confusing, rather use update
Updated as per suggestions.
Hi @phofl , thanks for your suggestions. I have updated the doc. The Code Checks/Pre-commit is failing. I think there is some trailing white-space which I missed. Is there any documentation organisation or information architecture related issue there in pandas that I can do ? |
You can run pre-commit locally to fix the problems |
I checked with |
Please check https://pandas.pydata.org/docs/development/contributing_codebase.html#contributing-pre-commit The section explains how to run pre-commit hooks |
I ran pre-commit and I got this result. Pre-commit(pandas-dev) gitpod > /workspace/pandas $ pre-commit run --files frame.py [INFO] Initializing environment for local:black==23.1.0. |
you have to run pre-commit run --all-files if its not active while committing |
Thanks @phofl, I think this time it will pass the test. I wanted to know if there is any documentation organisation or information architecture type of issue is there in pandas ? I want to work on this type of issues too. |
You'll have to search the issue tracker |
Some ci checks has failed. Could you suggest how to rectify it ? |
DOC add example of DataFrame.index #52835
This is related to changes in NumPy, not your PR. so you don't have to worry about it |
Thanks @phofl |
Co-authored-by: Patrick Hoefler <61934744+phofl@users.noreply.github.com>
thx @ggold7046 |
Hi @phofl , could you please tell me how do I search |
DOC add example of DataFrame.index
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.