DOC add example of DataFrame.index
State: closed

DOC add example of DataFrame.index

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Docs

Comments:
Here is the screenshots.

![DataFrame](https://user-images.githubusercontent.com/98327736/233711686-0e59a4a6-8b9f-4f2e-a9a6-01ae3d2b17ad.png)
![DataFrame2](https://user-images.githubusercontent.com/98327736/233711676-29395b1c-12c8-41b6-880c-5e129952e592.png)

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 `python scripts/validate_docstrings.py pandas.DataFrame.index`  and it returned `Docstring for "pandas.DataFrame.index" correct. :)` .
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.

<details>
<summary>Pre-commit</summary>
<br>

(pandas-dev) gitpod > /workspace/pandas $ pre-commit run --files frame.py

[INFO] Initializing environment for local:black==23.1.0.
[INFO] Initializing environment for https://github.com/charliermarsh/ruff-pre-commit.
[INFO] Initializing environment for https://github.com/jendrikseipp/vulture.
[INFO] Initializing environment for https://github.com/codespell-project/codespell.
[INFO] Initializing environment for https://github.com/codespell-project/codespell:tomli.
[INFO] Initializing environment for https://github.com/MarcoGorelli/cython-lint.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/cpplint/cpplint.
[INFO] Initializing environment for https://github.com/pycqa/pylint.
[INFO] Initializing environment for https://github.com/PyCQA/isort.
[INFO] Initializing environment for https://github.com/asottile/pyupgrade.
[INFO] Initializing environment for https://github.com/pre-commit/pygrep-hooks.
[INFO] Initializing environment for https://github.com/sphinx-contrib/sphinx-lint.
[INFO] Initializing environment for local:pyright@1.1.292.
[INFO] Initializing environment for local.
[INFO] Initializing environment for local:tomli,pyyaml.
[INFO] Initializing environment for local:autotyping==23.3.0,libcst==0.4.9.
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/charliermarsh/ruff-pre-commit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/jendrikseipp/vulture.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/codespell-project/codespell.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/MarcoGorelli/cython-lint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/cpplint/cpplint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/PyCQA/isort.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/asottile/pyupgrade.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/sphinx-contrib/sphinx-lint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
black...............................................................................(no files to check)Skipped
ruff................................................................................(no files to check)Skipped
vulture.............................................................................(no files to check)Skipped
codespell...........................................................................(no files to check)Skipped
cython-lint.........................................................................(no files to check)Skipped
double-quote Cython strings.........................................................(no files to check)Skipped
debug statements (python)...........................................................(no files to check)Skipped
fix end of files....................................................................(no files to check)Skipped
trim trailing whitespace............................................................(no files to check)Skipped
cpplint.............................................................................(no files to check)Skipped
isort...............................................................................(no files to check)Skipped
pyupgrade...........................................................................(no files to check)Skipped
rst ``code`` is two backticks.......................................................(no files to check)Skipped
rst directives end with two colons..................................................(no files to check)Skipped
rst ``inline code`` next to normal text.............................................(no files to check)Skipped
Sphinx lint.........................................................................(no files to check)Skipped
Check for inconsistent use of pandas namespace......................................(no files to check)Skipped
Check code for instances of os.remove...............................................(no files to check)Skipped
Unwanted patterns...................................................................(no files to check)Skipped
Check Cython casting is `<type>obj`, not `<type> obj`...............................(no files to check)Skipped
Check for backticks incorrectly rendering because of missing spaces.................(no files to check)Skipped
Check for unnecessary random seeds in asv benchmarks................................(no files to check)Skipped
Check for usage of numpy testing or array_equal.....................................(no files to check)Skipped
Check for invalid EA testing........................................................(no files to check)Skipped
Unwanted patterns in tests..........................................................(no files to check)Skipped
Unwanted patterns in EA tests.......................................................(no files to check)Skipped
Unwanted patterns in Cython code....................................................(no files to check)Skipped
Generate pip dependency from conda..................................................(no files to check)Skipped
Validate correct capitalization among titles in documentation.......................(no files to check)Skipped
Check for use of bare pytest raises.................................................(no files to check)Skipped
Check for use of private functions across modules...................................(no files to check)Skipped
Check for import of private attributes across modules...............................(no files to check)Skipped
Check for strings with misplaced spaces.............................................(no files to check)Skipped
Import pandas.array as pd_array in core.............................................(no files to check)Skipped
Use pandas.io.common.urlopen instead of urllib.request.urlopen......................(no files to check)Skipped
Use bool_t instead of bool in pandas/core/generic.py................................(no files to check)Skipped
Use raise instead of return for exceptions..........................................(no files to check)Skipped
Ensure pandas errors are documented in doc/source/reference/testing.rst.............(no files to check)Skipped
Check for pg8000 not installed on CI for test_pg8000_sqlalchemy_passthrough_error...(no files to check)Skipped
Check minimum version of dependencies are aligned...................................(no files to check)Skipped
Validate errors locations...........................................................(no files to check)Skipped
import annotations from __future__..................................................(no files to check)Skipped
check that test names start with 'test'.............................................(no files to check)Skipped
sort whatsnew entries alphabetically................................................(no files to check)Skipped
</details>
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 ? 
This is related to changes in NumPy, not your PR. so you don't have to worry about it
Thanks @phofl 
thx @ggold7046 
> documentation organisation or information architecture type of issue is there in pandas ?

Hi @phofl , could you please tell me how do I search `documentation organisation` or `information architecture` type of issue in pandas issue tracker?