Skip to content

Commit f43a10c

Browse files
committed
DOC: add note about DataFrame index in 01-table_oriented
1 parent 0f4222e commit f43a10c

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@ documentation.
2626
</li>
2727
</ul>
2828

29-
pandas data table representation
29+
Pandas representation of Data
3030
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31+
.. note::
32+
33+
Each DataFrame has an *index*, which uniquely identifies each row.
34+
By default, it appears as the leftmost label in the table.
35+
For more about the index, see :ref:`user_guide/indexing`.
36+
3137

3238
.. image:: ../../_static/schemas/01_table_dataframe.svg
3339
:align: center
@@ -55,7 +61,13 @@ I want to store passenger data of the Titanic. For a number of passengers, I kno
5561
df
5662
5763
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
58-
the values in each list as columns of the ``DataFrame``.
64+
the values in each list as columns of the ``DataFrame``.
65+
.. note::
66+
67+
Each DataFrame has an *index*, which uniquely identifies each row.
68+
By default, it appears as the leftmost label in the table.
69+
For more about the index, see :ref:`user_guide/indexing`.
70+
5971

6072
.. raw:: html
6173

@@ -70,7 +82,7 @@ SQL table or the ``data.frame`` in `R <https://www.r-project.org/>`__.
7082
- The table has 3 columns, each of them with a column label. The column
7183
labels are respectively ``Name``, ``Age`` and ``Sex``.
7284
- The column ``Name`` consists of textual data with each value a
73-
string, the column ``Age`` are numbers and the column ``Sex`` is
85+
string, the column ``Age`` contains numbers and the column ``Sex`` contains
7486
textual data.
7587

7688
In spreadsheet software, the table representation of our data would look
@@ -220,3 +232,7 @@ A more extended explanation of ``DataFrame`` and ``Series`` is provided in the :
220232
.. raw:: html
221233

222234
</div>
235+
.. tip::
236+
237+
You can select rows by index using ``df.loc[index]`` or ``df.iloc[position]``.
238+

0 commit comments

Comments
 (0)