Skip to content

Commit b195361

Browse files
authored
DOC: Grammar improvements in getting started tutorials (#58706)
1 parent 4829b36 commit b195361

9 files changed

+30
-32
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ Check more options on ``describe`` in the user guide section about :ref:`aggrega
192192
.. note::
193193
This is just a starting point. Similar to spreadsheet
194194
software, pandas represents data as a table with columns and rows. Apart
195-
from the representation, also the data manipulations and calculations
196-
you would do in spreadsheet software are supported by pandas. Continue
195+
from the representation, the data manipulations and calculations
196+
you would do in spreadsheet software are also supported by pandas. Continue
197197
reading the next tutorials to get started!
198198

199199
.. raw:: html
@@ -204,7 +204,7 @@ Check more options on ``describe`` in the user guide section about :ref:`aggrega
204204
- Import the package, aka ``import pandas as pd``
205205
- A table of data is stored as a pandas ``DataFrame``
206206
- Each column in a ``DataFrame`` is a ``Series``
207-
- You can do things by applying a method to a ``DataFrame`` or ``Series``
207+
- You can do things by applying a method on a ``DataFrame`` or ``Series``
208208

209209
.. raw:: html
210210

@@ -215,7 +215,7 @@ Check more options on ``describe`` in the user guide section about :ref:`aggrega
215215
<div class="d-flex flex-row gs-torefguide">
216216
<span class="badge badge-info">To user guide</span>
217217

218-
A more extended explanation to ``DataFrame`` and ``Series`` is provided in the :ref:`introduction to data structures <dsintro>`.
218+
A more extended explanation of ``DataFrame`` and ``Series`` is provided in the :ref:`introduction to data structures <dsintro>` page.
219219

220220
.. raw:: html
221221

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ The method :meth:`~DataFrame.info` provides technical information about a
172172
- The table has 12 columns. Most columns have a value for each of the
173173
rows (all 891 values are ``non-null``). Some columns do have missing
174174
values and less than 891 ``non-null`` values.
175-
- The columns ``Name``, ``Sex``, ``Cabin`` and ``Embarked`` consists of
175+
- The columns ``Name``, ``Sex``, ``Cabin`` and ``Embarked`` consist of
176176
textual data (strings, aka ``object``). The other columns are
177-
numerical data with some of them whole numbers (aka ``integer``) and
178-
others are real numbers (aka ``float``).
179-
- The kind of data (characters, integers,…) in the different columns
177+
numerical data, some of them are whole numbers (``integer``) and
178+
others are real numbers (``float``).
179+
- The kind of data (characters, integers, …) in the different columns
180180
are summarized by listing the ``dtypes``.
181181
- The approximate amount of RAM used to hold the DataFrame is provided
182182
as well.
@@ -194,7 +194,7 @@ The method :meth:`~DataFrame.info` provides technical information about a
194194
- Getting data in to pandas from many different file formats or data
195195
sources is supported by ``read_*`` functions.
196196
- Exporting data out of pandas is provided by different
197-
``to_*``\ methods.
197+
``to_*`` methods.
198198
- The ``head``/``tail``/``info`` methods and the ``dtypes`` attribute
199199
are convenient for a first check.
200200

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

+4-6
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ want to select.
300300
</li>
301301
</ul>
302302

303-
When using the column names, row labels or a condition expression, use
303+
When using column names, row labels or a condition expression, use
304304
the ``loc`` operator in front of the selection brackets ``[]``. For both
305305
the part before and after the comma, you can use a single label, a list
306306
of labels, a slice of labels, a conditional expression or a colon. Using
@@ -342,7 +342,7 @@ the name ``anonymous`` to the first 3 elements of the fourth column:
342342
<div class="d-flex flex-row gs-torefguide">
343343
<span class="badge badge-info">To user guide</span>
344344

345-
See the user guide section on :ref:`different choices for indexing <indexing.choice>` to get more insight in the usage of ``loc`` and ``iloc``.
345+
See the user guide section on :ref:`different choices for indexing <indexing.choice>` to get more insight into the usage of ``loc`` and ``iloc``.
346346

347347
.. raw:: html
348348

@@ -357,10 +357,8 @@ See the user guide section on :ref:`different choices for indexing <indexing.cho
357357
- 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.
360-
- Select specific rows and/or columns using ``loc`` when using the row
361-
and column names.
362-
- Select specific rows and/or columns using ``iloc`` when using the
363-
positions in the table.
360+
- Use ``loc`` for label-based selection (using row/column names).
361+
- Use ``iloc`` for position-based selection (using table positions).
364362
- You can assign new values to a selection based on ``loc``/``iloc``.
365363

366364
.. raw:: html

doc/source/getting_started/intro_tutorials/04_plotting.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ I want to plot only the columns of the data table with the data from Paris.
8585
air_quality["station_paris"].plot()
8686
plt.show()
8787
88-
To plot a specific column, use the selection method of the
88+
To plot a specific column, use a selection method from the
8989
:ref:`subset data tutorial <10min_tut_03_subset>` in combination with the :meth:`~DataFrame.plot`
9090
method. Hence, the :meth:`~DataFrame.plot` method works on both ``Series`` and
9191
``DataFrame``.
@@ -127,7 +127,7 @@ standard Python to get an overview of the available plot methods:
127127
]
128128
129129
.. note::
130-
In many development environments as well as IPython and
130+
In many development environments such as IPython and
131131
Jupyter Notebook, use the TAB button to get an overview of the available
132132
methods, for example ``air_quality.plot.`` + TAB.
133133

@@ -238,7 +238,7 @@ This strategy is applied in the previous example:
238238

239239
- The ``.plot.*`` methods are applicable on both Series and DataFrames.
240240
- By default, each of the columns is plotted as a different element
241-
(line, boxplot,…).
241+
(line, boxplot, …).
242242
- Any plot created by pandas is a Matplotlib object.
243243

244244
.. raw:: html

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ values in each row*.
8989
</li>
9090
</ul>
9191

92-
Also other mathematical operators (``+``, ``-``, ``*``, ``/``,…) or
93-
logical operators (``<``, ``>``, ``==``,…) work element-wise. The latter was already
92+
Other mathematical operators (``+``, ``-``, ``*``, ``/``, …) and logical
93+
operators (``<``, ``>``, ``==``, …) also work element-wise. The latter was already
9494
used in the :ref:`subset data tutorial <10min_tut_03_subset>` to filter
9595
rows of a table using a conditional expression.
9696

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ category in a column.
235235
</li>
236236
</ul>
237237

238-
The function is a shortcut, as it is actually a groupby operation in combination with counting of the number of records
238+
The function is a shortcut, it is actually a groupby operation in combination with counting the number of records
239239
within each group:
240240

241241
.. ipython:: python

doc/source/getting_started/intro_tutorials/08_combine_dataframes.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Hence, the resulting table has 3178 = 1110 + 2068 rows.
137137
Most operations like concatenation or summary statistics are by default
138138
across rows (axis 0), but can be applied across columns as well.
139139

140-
Sorting the table on the datetime information illustrates also the
140+
Sorting the table on the datetime information also illustrates the
141141
combination of both tables, with the ``parameter`` column defining the
142142
origin of the table (either ``no2`` from table ``air_quality_no2`` or
143143
``pm25`` from table ``air_quality_pm25``):
@@ -286,7 +286,7 @@ between the two tables.
286286
<div class="d-flex flex-row gs-torefguide">
287287
<span class="badge badge-info">To user guide</span>
288288

289-
pandas supports also inner, outer, and right joins.
289+
pandas also supports inner, outer, and right joins.
290290
More information on join/merge of tables is provided in the user guide section on
291291
:ref:`database style merging of tables <merging.join>`. Or have a look at the
292292
:ref:`comparison with SQL<compare_with_sql.join>` page.
@@ -300,7 +300,7 @@ More information on join/merge of tables is provided in the user guide section o
300300
<div class="shadow gs-callout gs-callout-remember">
301301
<h4>REMEMBER</h4>
302302

303-
- Multiple tables can be concatenated both column-wise and row-wise using
303+
- Multiple tables can be concatenated column-wise or row-wise using
304304
the ``concat`` function.
305305
- For database-like merging/joining of tables, use the ``merge``
306306
function.

doc/source/getting_started/intro_tutorials/09_timeseries.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ I want to work with the dates in the column ``datetime`` as datetime objects ins
7777
7878
Initially, the values in ``datetime`` are character strings and do not
7979
provide any datetime operations (e.g. extract the year, day of the
80-
week,…). By applying the ``to_datetime`` function, pandas interprets the
80+
week, …). By applying the ``to_datetime`` function, pandas interprets the
8181
strings and convert these to datetime (i.e. ``datetime64[ns, UTC]``)
82-
objects. In pandas we call these datetime objects similar to
82+
objects. In pandas we call these datetime objects that are similar to
8383
``datetime.datetime`` from the standard library as :class:`pandas.Timestamp`.
8484

8585
.. raw:: html
@@ -117,7 +117,7 @@ length of our time series:
117117
air_quality["datetime"].max() - air_quality["datetime"].min()
118118
119119
The result is a :class:`pandas.Timedelta` object, similar to ``datetime.timedelta``
120-
from the standard Python library and defining a time duration.
120+
from the standard Python library which defines a time duration.
121121

122122
.. raw:: html
123123

@@ -257,7 +257,7 @@ the adapted time scale on plots. Let’s apply this on our data.
257257
<ul class="task-bullet">
258258
<li>
259259

260-
Create a plot of the :math:`NO_2` values in the different stations from the 20th of May till the end of 21st of May
260+
Create a plot of the :math:`NO_2` values in the different stations from May 20th till the end of May 21st.
261261

262262
.. ipython:: python
263263
:okwarning:
@@ -310,7 +310,7 @@ converting secondly data into 5-minutely data).
310310
The :meth:`~Series.resample` method is similar to a groupby operation:
311311

312312
- it provides a time-based grouping, by using a string (e.g. ``M``,
313-
``5H``,…) that defines the target frequency
313+
``5H``, …) that defines the target frequency
314314
- it requires an aggregation function such as ``mean``, ``max``,…
315315

316316
.. raw:: html

doc/source/getting_started/intro_tutorials/10_text_data.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ only one countess on the Titanic, we get one row as a result.
134134
.. note::
135135
More powerful extractions on strings are supported, as the
136136
:meth:`Series.str.contains` and :meth:`Series.str.extract` methods accept `regular
137-
expressions <https://docs.python.org/3/library/re.html>`__, but out of
138-
scope of this tutorial.
137+
expressions <https://docs.python.org/3/library/re.html>`__, but are out of
138+
the scope of this tutorial.
139139

140140
.. raw:: html
141141

@@ -200,7 +200,7 @@ In the "Sex" column, replace values of "male" by "M" and values of "female" by "
200200
201201
Whereas :meth:`~Series.replace` is not a string method, it provides a convenient way
202202
to use mappings or vocabularies to translate certain values. It requires
203-
a ``dictionary`` to define the mapping ``{from : to}``.
203+
a ``dictionary`` to define the mapping ``{from: to}``.
204204

205205
.. raw:: html
206206

0 commit comments

Comments
 (0)