Skip to content

Commit caf793e

Browse files
DOC: Add explanation of index to 10min tutorial table-oriented section
1 parent 88c276a commit caf793e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

doc/source/getting_started/intro_tutorials/01_table_oriented.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ I want to store passenger data of the Titanic. For a number of passengers, I kno
5454
)
5555
df
5656
57+
By default, pandas assigns an index (the row labels) starting from 0.
58+
The index uniquely identifies each row in the ``DataFrame`` and is used for selecting and aligning data.
59+
60+
5761
To manually store data in a table, create a ``DataFrame``. When using a Python dictionary of lists, the dictionary keys will be used as column headers and
5862
the values in each list as columns of the ``DataFrame``.
5963

@@ -118,8 +122,10 @@ You can create a ``Series`` from scratch as well:
118122
ages = pd.Series([22, 35, 58], name="Age")
119123
ages
120124
121-
A pandas ``Series`` has no column labels, as it is just a single column
122-
of a ``DataFrame``. A Series does have row labels.
125+
A ``Series`` does not have column labels because it represents a single column, but it does have an index (row labels).
126+
The index is a fundamental part of both ``Series`` and ``DataFrame`` objects and is used for selecting, aligning, and manipulating data.
127+
See the :ref:`indexing and selecting data <indexing>` section for more details.
128+
123129

124130
Do something with a DataFrame or Series
125131
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)