Skip to content

Commit 0a841ae

Browse files
authored
DOC: Clarifying brackets vs. parentheses (#57236)
1 parent bc58fe5 commit 0a841ae

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

doc/source/getting_started/intro_tutorials/02_read_write.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ in this ``DataFrame`` are integers (``int64``), floats (``float64``) and
9797
strings (``object``).
9898

9999
.. note::
100-
When asking for the ``dtypes``, no brackets are used!
100+
When asking for the ``dtypes``, no parentheses ``()`` are used!
101101
``dtypes`` is an attribute of a ``DataFrame`` and ``Series``. Attributes
102-
of a ``DataFrame`` or ``Series`` do not need brackets. Attributes
102+
of a ``DataFrame`` or ``Series`` do not need ``()``. Attributes
103103
represent a characteristic of a ``DataFrame``/``Series``, whereas
104-
methods (which require brackets) *do* something with the
104+
methods (which require parentheses ``()``) *do* something with the
105105
``DataFrame``/``Series`` as introduced in the :ref:`first tutorial <10min_tut_01_tableoriented>`.
106106

107107
.. raw:: html

doc/source/getting_started/intro_tutorials/03_subset_data.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ selection brackets ``[]``.
101101
.. note::
102102
The inner square brackets define a
103103
:ref:`Python list <python:tut-morelists>` with column names, whereas
104-
the outer brackets are used to select the data from a pandas
104+
the outer square brackets are used to select the data from a pandas
105105
``DataFrame`` as seen in the previous example.
106106

107107
The returned data type is a pandas DataFrame:
@@ -354,7 +354,7 @@ See the user guide section on :ref:`different choices for indexing <indexing.cho
354354
<h4>REMEMBER</h4>
355355

356356
- When selecting subsets of data, square brackets ``[]`` are used.
357-
- Inside these brackets, you can use a single column/row label, a list
357+
- Inside these square brackets, you can use a single column/row label, a list
358358
of column/row labels, a slice of labels, a conditional expression or
359359
a colon.
360360
- Select specific rows and/or columns using ``loc`` when using the row

doc/source/getting_started/intro_tutorials/05_add_columns.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ hPa, the conversion factor is 1.882*)
5151
air_quality["london_mg_per_cubic"] = air_quality["station_london"] * 1.882
5252
air_quality.head()
5353
54-
To create a new column, use the ``[]`` brackets with the new column name
54+
To create a new column, use the square brackets ``[]`` with the new column name
5555
at the left side of the assignment.
5656

5757
.. raw:: html

doc/source/getting_started/intro_tutorials/06_calculate_statistics.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ columns by passing ``numeric_only=True``:
162162
163163
It does not make much sense to get the average value of the ``Pclass``.
164164
If we are only interested in the average age for each gender, the
165-
selection of columns (rectangular brackets ``[]`` as usual) is supported
165+
selection of columns (square brackets ``[]`` as usual) is supported
166166
on the grouped data as well:
167167

168168
.. ipython:: python

0 commit comments

Comments
 (0)