Skip to content

Commit 0ede947

Browse files
authored
DOC: Fix typos and improve parts of docs (#33793)
* Fix typos and improve parts of docs * Apply review suggestions
1 parent 44e3c40 commit 0ede947

9 files changed

+39
-38
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div class="card-body">
2424
<p class="card-text">
2525

26-
This tutorial uses the titanic data set, stored as CSV. The data
26+
This tutorial uses the Titanic data set, stored as CSV. The data
2727
consists of the following data columns:
2828

2929
- PassengerId: Id of every passenger.
@@ -61,7 +61,7 @@ How do I read and write tabular data?
6161
<ul class="task-bullet">
6262
<li>
6363

64-
I want to analyse the titanic passenger data, available as a CSV file.
64+
I want to analyze the Titanic passenger data, available as a CSV file.
6565

6666
.. ipython:: python
6767
@@ -134,7 +134,7 @@ strings (``object``).
134134
<ul class="task-bullet">
135135
<li>
136136

137-
My colleague requested the titanic data as a spreadsheet.
137+
My colleague requested the Titanic data as a spreadsheet.
138138

139139
.. ipython:: python
140140

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ When using the column names, row labels or a condition expression, use
330330
the ``loc`` operator in front of the selection brackets ``[]``. For both
331331
the part before and after the comma, you can use a single label, a list
332332
of labels, a slice of labels, a conditional expression or a colon. Using
333-
a colon specificies you want to select all rows or columns.
333+
a colon specifies you want to select all rows or columns.
334334

335335
.. raw:: html
336336

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div class="card-body">
2424
<p class="card-text">
2525

26-
This tutorial uses the titanic data set, stored as CSV. The data
26+
This tutorial uses the Titanic data set, stored as CSV. The data
2727
consists of the following data columns:
2828

2929
- PassengerId: Id of every passenger.
@@ -72,7 +72,7 @@ Aggregating statistics
7272
<ul class="task-bullet">
7373
<li>
7474

75-
What is the average age of the titanic passengers?
75+
What is the average age of the Titanic passengers?
7676

7777
.. ipython:: python
7878
@@ -95,7 +95,7 @@ across rows by default.
9595
<ul class="task-bullet">
9696
<li>
9797

98-
What is the median age and ticket fare price of the titanic passengers?
98+
What is the median age and ticket fare price of the Titanic passengers?
9999

100100
.. ipython:: python
101101
@@ -148,7 +148,7 @@ Aggregating statistics grouped by category
148148
<ul class="task-bullet">
149149
<li>
150150

151-
What is the average age for male versus female titanic passengers?
151+
What is the average age for male versus female Titanic passengers?
152152

153153
.. ipython:: python
154154

doc/source/getting_started/intro_tutorials/07_reshape_table_layout.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div class="card-body">
2424
<p class="card-text">
2525

26-
This tutorial uses the titanic data set, stored as CSV. The data
26+
This tutorial uses the Titanic data set, stored as CSV. The data
2727
consists of the following data columns:
2828

2929
- PassengerId: Id of every passenger.
@@ -122,7 +122,7 @@ Sort table rows
122122
<ul class="task-bullet">
123123
<li>
124124

125-
I want to sort the titanic data according to the age of the passengers.
125+
I want to sort the Titanic data according to the age of the passengers.
126126

127127
.. ipython:: python
128128
@@ -138,7 +138,7 @@ I want to sort the titanic data according to the age of the passengers.
138138
<ul class="task-bullet">
139139
<li>
140140

141-
I want to sort the titanic data according to the cabin class and age in descending order.
141+
I want to sort the Titanic data according to the cabin class and age in descending order.
142142

143143
.. ipython:: python
144144
@@ -282,7 +282,7 @@ For more information about :meth:`~DataFrame.pivot_table`, see the user guide se
282282
</div>
283283

284284
.. note::
285-
If case you are wondering, :meth:`~DataFrame.pivot_table` is indeed directly linked
285+
In case you are wondering, :meth:`~DataFrame.pivot_table` is indeed directly linked
286286
to :meth:`~DataFrame.groupby`. The same result can be derived by grouping on both
287287
``parameter`` and ``location``:
288288

@@ -338,7 +338,7 @@ newly created column.
338338

339339
The solution is the short version on how to apply :func:`pandas.melt`. The method
340340
will *melt* all columns NOT mentioned in ``id_vars`` together into two
341-
columns: A columns with the column header names and a column with the
341+
columns: A column with the column header names and a column with the
342342
values itself. The latter column gets by default the name ``value``.
343343

344344
The :func:`pandas.melt` method can be defined in more detail:
@@ -357,8 +357,8 @@ The result in the same, but in more detail defined:
357357

358358
- ``value_vars`` defines explicitly which columns to *melt* together
359359
- ``value_name`` provides a custom column name for the values column
360-
instead of the default columns name ``value``
361-
- ``var_name`` provides a custom column name for the columns collecting
360+
instead of the default column name ``value``
361+
- ``var_name`` provides a custom column name for the column collecting
362362
the column header names. Otherwise it takes the index name or a
363363
default ``variable``
364364

@@ -383,7 +383,7 @@ Conversion from wide to long format with :func:`pandas.melt` is explained in the
383383
<h4>REMEMBER</h4>
384384

385385
- Sorting by one or more columns is supported by ``sort_values``
386-
- The ``pivot`` function is purely restructering of the data,
386+
- The ``pivot`` function is purely restructuring of the data,
387387
``pivot_table`` supports aggregations
388388
- The reverse of ``pivot`` (long to wide format) is ``melt`` (wide to
389389
long format)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ More information on join/merge of tables is provided in the user guide section o
305305
<div class="shadow gs-callout gs-callout-remember">
306306
<h4>REMEMBER</h4>
307307

308-
- Multiple tables can be concatenated both column as row wise using
308+
- Multiple tables can be concatenated both column-wise and row-wise using
309309
the ``concat`` function.
310310
- For database-like merging/joining of tables, use the ``merge``
311311
function.

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ provide any datetime operations (e.g. extract the year, day of the
7878
week,…). By applying the ``to_datetime`` function, pandas interprets the
7979
strings and convert these to datetime (i.e. ``datetime64[ns, UTC]``)
8080
objects. In pandas we call these datetime objects similar to
81-
``datetime.datetime`` from the standard library a :class:`pandas.Timestamp`.
81+
``datetime.datetime`` from the standard library as :class:`pandas.Timestamp`.
8282

8383
.. raw:: html
8484

@@ -99,7 +99,7 @@ objects. In pandas we call these datetime objects similar to
9999
Why are these :class:`pandas.Timestamp` objects useful? Let’s illustrate the added
100100
value with some example cases.
101101

102-
What is the start and end date of the time series data set working
102+
What is the start and end date of the time series data set we are working
103103
with?
104104

105105
.. ipython:: python
@@ -214,7 +214,7 @@ Plot the typical :math:`NO_2` pattern during the day of our time series of all s
214214
215215
Similar to the previous case, we want to calculate a given statistic
216216
(e.g. mean :math:`NO_2`) **for each hour of the day** and we can use the
217-
split-apply-combine approach again. For this case, the datetime property ``hour``
217+
split-apply-combine approach again. For this case, we use the datetime property ``hour``
218218
of pandas ``Timestamp``, which is also accessible by the ``dt`` accessor.
219219

220220
.. raw:: html

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div class="card-body">
2424
<p class="card-text">
2525

26-
This tutorial uses the titanic data set, stored as CSV. The data
26+
This tutorial uses the Titanic data set, stored as CSV. The data
2727
consists of the following data columns:
2828

2929
- PassengerId: Id of every passenger.
@@ -102,7 +102,7 @@ Create a new column ``Surname`` that contains the surname of the Passengers by e
102102
103103
Using the :meth:`Series.str.split` method, each of the values is returned as a list of
104104
2 elements. The first element is the part before the comma and the
105-
second element the part after the comma.
105+
second element is the part after the comma.
106106

107107
.. ipython:: python
108108
@@ -135,7 +135,7 @@ More information on extracting parts of strings is available in the user guide s
135135
<ul class="task-bullet">
136136
<li>
137137

138-
Extract the passenger data about the Countess on board of the Titanic.
138+
Extract the passenger data about the Countesses on board of the Titanic.
139139

140140
.. ipython:: python
141141
@@ -145,24 +145,24 @@ Extract the passenger data about the Countess on board of the Titanic.
145145
146146
titanic[titanic["Name"].str.contains("Countess")]
147147
148-
(*Interested in her story? See*\ `Wikipedia <https://en.wikipedia.org/wiki/No%C3%ABl_Leslie,_Countess_of_Rothes>`__\ *!*)
148+
(*Interested in her story? See *\ `Wikipedia <https://en.wikipedia.org/wiki/No%C3%ABl_Leslie,_Countess_of_Rothes>`__\ *!*)
149149

150150
The string method :meth:`Series.str.contains` checks for each of the values in the
151151
column ``Name`` if the string contains the word ``Countess`` and returns
152152
for each of the values ``True`` (``Countess`` is part of the name) of
153-
``False`` (``Countess`` is notpart of the name). This output can be used
153+
``False`` (``Countess`` is not part of the name). This output can be used
154154
to subselect the data using conditional (boolean) indexing introduced in
155155
the :ref:`subsetting of data tutorial <10min_tut_03_subset>`. As there was
156-
only 1 Countess on the Titanic, we get one row as a result.
156+
only one Countess on the Titanic, we get one row as a result.
157157

158158
.. raw:: html
159159

160160
</li>
161161
</ul>
162162

163163
.. note::
164-
More powerful extractions on strings is supported, as the
165-
:meth:`Series.str.contains` and :meth:`Series.str.extract` methods accepts `regular
164+
More powerful extractions on strings are supported, as the
165+
:meth:`Series.str.contains` and :meth:`Series.str.extract` methods accept `regular
166166
expressions <https://docs.python.org/3/library/re.html>`__, but out of
167167
scope of this tutorial.
168168

@@ -182,7 +182,7 @@ More information on extracting parts of strings is available in the user guide s
182182
<ul class="task-bullet">
183183
<li>
184184

185-
Which passenger of the titanic has the longest name?
185+
Which passenger of the Titanic has the longest name?
186186

187187
.. ipython:: python
188188
@@ -220,7 +220,7 @@ we can do a selection using the ``loc`` operator, introduced in the
220220
<ul class="task-bullet">
221221
<li>
222222

223-
In the Sex’ columns, replace values of male by ‘M’ and all ‘female’ values by ‘F’
223+
In the "Sex" column, replace values of "male" by "M" and values of "female" by "F"
224224

225225
.. ipython:: python
226226

doc/source/user_guide/10min.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ Convert the raw grades to a categorical data type.
664664
df["grade"]
665665
666666
Rename the categories to more meaningful names (assigning to
667-
:meth:`Series.cat.categories` is inplace!).
667+
:meth:`Series.cat.categories` is in place!).
668668

669669
.. ipython:: python
670670

doc/source/user_guide/basics.rst

+8-7
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ the ``.array`` property
6868
s.index.array
6969
7070
:attr:`~Series.array` will always be an :class:`~pandas.api.extensions.ExtensionArray`.
71-
The exact details of what an :class:`~pandas.api.extensions.ExtensionArray` is and why pandas uses them is a bit
71+
The exact details of what an :class:`~pandas.api.extensions.ExtensionArray` is and why pandas uses them are a bit
7272
beyond the scope of this introduction. See :ref:`basics.dtypes` for more.
7373

7474
If you know you need a NumPy array, use :meth:`~Series.to_numpy`
@@ -518,7 +518,7 @@ data (``True`` by default):
518518
519519
Combined with the broadcasting / arithmetic behavior, one can describe various
520520
statistical procedures, like standardization (rendering data zero mean and
521-
standard deviation 1), very concisely:
521+
standard deviation of 1), very concisely:
522522

523523
.. ipython:: python
524524
@@ -700,7 +700,7 @@ By default all columns are used but a subset can be selected using the ``subset`
700700
frame = pd.DataFrame(data)
701701
frame.value_counts()
702702
703-
Similarly, you can get the most frequently occurring value(s) (the mode) of the values in a Series or DataFrame:
703+
Similarly, you can get the most frequently occurring value(s), i.e. the mode, of the values in a Series or DataFrame:
704704

705705
.. ipython:: python
706706
@@ -1022,7 +1022,7 @@ Mixed dtypes
10221022
++++++++++++
10231023

10241024
When presented with mixed dtypes that cannot aggregate, ``.agg`` will only take the valid
1025-
aggregations. This is similar to how groupby ``.agg`` works.
1025+
aggregations. This is similar to how ``.groupby.agg`` works.
10261026

10271027
.. ipython:: python
10281028
@@ -1041,7 +1041,7 @@ aggregations. This is similar to how groupby ``.agg`` works.
10411041
Custom describe
10421042
+++++++++++++++
10431043

1044-
With ``.agg()`` is it possible to easily create a custom describe function, similar
1044+
With ``.agg()`` it is possible to easily create a custom describe function, similar
10451045
to the built in :ref:`describe function <basics.describe>`.
10461046

10471047
.. ipython:: python
@@ -1083,7 +1083,8 @@ function name or a user defined function.
10831083
tsdf.transform('abs')
10841084
tsdf.transform(lambda x: x.abs())
10851085
1086-
Here :meth:`~DataFrame.transform` received a single function; this is equivalent to a ufunc application.
1086+
Here :meth:`~DataFrame.transform` received a single function; this is equivalent to a `ufunc
1087+
<https://numpy.org/doc/stable/reference/ufuncs.html>`__ application.
10871088

10881089
.. ipython:: python
10891090
@@ -1457,7 +1458,7 @@ for altering the ``Series.name`` attribute.
14571458

14581459
.. versionadded:: 0.24.0
14591460

1460-
The methods :meth:`~DataFrame.rename_axis` and :meth:`~Series.rename_axis`
1461+
The methods :meth:`DataFrame.rename_axis` and :meth:`Series.rename_axis`
14611462
allow specific names of a `MultiIndex` to be changed (as opposed to the
14621463
labels).
14631464

0 commit comments

Comments
 (0)