Skip to content

Commit c1845a5

Browse files
datapythonistaPingviinituutti
authored andcommitted
DOC: Removing tailing whitespaces in .rst files (pandas-dev#24281)
1 parent 1043feb commit c1845a5

10 files changed

+103
-103
lines changed

doc/source/advanced.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ can think of ``MultiIndex`` as an array of tuples where each tuple is unique. A
5454
``MultiIndex`` can be created from a list of arrays (using
5555
:meth:`MultiIndex.from_arrays`), an array of tuples (using
5656
:meth:`MultiIndex.from_tuples`), a crossed set of iterables (using
57-
:meth:`MultiIndex.from_product`), or a :class:`DataFrame` (using
57+
:meth:`MultiIndex.from_product`), or a :class:`DataFrame` (using
5858
:meth:`MultiIndex.from_frame`). The ``Index`` constructor will attempt to return
5959
a ``MultiIndex`` when it is passed a list of tuples. The following examples
6060
demonstrate different ways to initialize MultiIndexes.
@@ -81,7 +81,7 @@ to use the :meth:`MultiIndex.from_product` method:
8181
iterables = [['bar', 'baz', 'foo', 'qux'], ['one', 'two']]
8282
pd.MultiIndex.from_product(iterables, names=['first', 'second'])
8383
84-
You can also construct a ``MultiIndex`` from a ``DataFrame`` directly, using
84+
You can also construct a ``MultiIndex`` from a ``DataFrame`` directly, using
8585
the method :meth:`MultiIndex.from_frame`. This is a complementary method to
8686
:meth:`MultiIndex.to_frame`.
8787

doc/source/categorical.rst

+31-31
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ with R's ``factor``.
1111

1212
`Categoricals` are a pandas data type corresponding to categorical variables in
1313
statistics. A categorical variable takes on a limited, and usually fixed,
14-
number of possible values (`categories`; `levels` in R). Examples are gender,
15-
social class, blood type, country affiliation, observation time or rating via
14+
number of possible values (`categories`; `levels` in R). Examples are gender,
15+
social class, blood type, country affiliation, observation time or rating via
1616
Likert scales.
1717

1818
In contrast to statistical categorical variables, categorical data might have an order (e.g.
@@ -133,7 +133,7 @@ This conversion is likewise done column by column:
133133
Controlling Behavior
134134
~~~~~~~~~~~~~~~~~~~~
135135

136-
In the examples above where we passed ``dtype='category'``, we used the default
136+
In the examples above where we passed ``dtype='category'``, we used the default
137137
behavior:
138138

139139
1. Categories are inferred from the data.
@@ -170,8 +170,8 @@ are consistent among all columns.
170170
categories for each column, the ``categories`` parameter can be determined programmatically by
171171
``categories = pd.unique(df.to_numpy().ravel())``.
172172

173-
If you already have ``codes`` and ``categories``, you can use the
174-
:func:`~pandas.Categorical.from_codes` constructor to save the factorize step
173+
If you already have ``codes`` and ``categories``, you can use the
174+
:func:`~pandas.Categorical.from_codes` constructor to save the factorize step
175175
during normal constructor mode:
176176

177177
.. ipython:: python
@@ -184,7 +184,7 @@ during normal constructor mode:
184184
Regaining Original Data
185185
~~~~~~~~~~~~~~~~~~~~~~~
186186

187-
To get back to the original ``Series`` or NumPy array, use
187+
To get back to the original ``Series`` or NumPy array, use
188188
``Series.astype(original_dtype)`` or ``np.asarray(categorical)``:
189189

190190
.. ipython:: python
@@ -222,7 +222,7 @@ This information can be stored in a :class:`~pandas.api.types.CategoricalDtype`.
222222
The ``categories`` argument is optional, which implies that the actual categories
223223
should be inferred from whatever is present in the data when the
224224
:class:`pandas.Categorical` is created. The categories are assumed to be unordered
225-
by default.
225+
by default.
226226

227227
.. ipython:: python
228228
@@ -277,7 +277,7 @@ All instances of ``CategoricalDtype`` compare equal to the string ``'category'``
277277
Description
278278
-----------
279279

280-
Using :meth:`~DataFrame.describe` on categorical data will produce similar
280+
Using :meth:`~DataFrame.describe` on categorical data will produce similar
281281
output to a ``Series`` or ``DataFrame`` of type ``string``.
282282

283283
.. ipython:: python
@@ -292,9 +292,9 @@ output to a ``Series`` or ``DataFrame`` of type ``string``.
292292
Working with categories
293293
-----------------------
294294

295-
Categorical data has a `categories` and a `ordered` property, which list their
296-
possible values and whether the ordering matters or not. These properties are
297-
exposed as ``s.cat.categories`` and ``s.cat.ordered``. If you don't manually
295+
Categorical data has a `categories` and a `ordered` property, which list their
296+
possible values and whether the ordering matters or not. These properties are
297+
exposed as ``s.cat.categories`` and ``s.cat.ordered``. If you don't manually
298298
specify categories and ordering, they are inferred from the passed arguments.
299299

300300
.. ipython:: python
@@ -314,7 +314,7 @@ It's also possible to pass in the categories in a specific order:
314314
315315
.. note::
316316

317-
New categorical data are **not** automatically ordered. You must explicitly
317+
New categorical data are **not** automatically ordered. You must explicitly
318318
pass ``ordered=True`` to indicate an ordered ``Categorical``.
319319

320320

@@ -338,8 +338,8 @@ It's also possible to pass in the categories in a specific order:
338338
Renaming categories
339339
~~~~~~~~~~~~~~~~~~~
340340

341-
Renaming categories is done by assigning new values to the
342-
``Series.cat.categories`` property or by using the
341+
Renaming categories is done by assigning new values to the
342+
``Series.cat.categories`` property or by using the
343343
:meth:`~pandas.Categorical.rename_categories` method:
344344

345345

@@ -385,7 +385,7 @@ Categories must also not be ``NaN`` or a `ValueError` is raised:
385385
Appending new categories
386386
~~~~~~~~~~~~~~~~~~~~~~~~
387387

388-
Appending categories can be done by using the
388+
Appending categories can be done by using the
389389
:meth:`~pandas.Categorical.add_categories` method:
390390

391391
.. ipython:: python
@@ -397,8 +397,8 @@ Appending categories can be done by using the
397397
Removing categories
398398
~~~~~~~~~~~~~~~~~~~
399399

400-
Removing categories can be done by using the
401-
:meth:`~pandas.Categorical.remove_categories` method. Values which are removed
400+
Removing categories can be done by using the
401+
:meth:`~pandas.Categorical.remove_categories` method. Values which are removed
402402
are replaced by ``np.nan``.:
403403

404404
.. ipython:: python
@@ -421,8 +421,8 @@ Removing unused categories can also be done:
421421
Setting categories
422422
~~~~~~~~~~~~~~~~~~
423423

424-
If you want to do remove and add new categories in one step (which has some
425-
speed advantage), or simply set the categories to a predefined scale,
424+
If you want to do remove and add new categories in one step (which has some
425+
speed advantage), or simply set the categories to a predefined scale,
426426
use :meth:`~pandas.Categorical.set_categories`.
427427

428428

@@ -618,10 +618,10 @@ When you compare two unordered categoricals with the same categories, the order
618618
Operations
619619
----------
620620

621-
Apart from :meth:`Series.min`, :meth:`Series.max` and :meth:`Series.mode`, the
621+
Apart from :meth:`Series.min`, :meth:`Series.max` and :meth:`Series.mode`, the
622622
following operations are possible with categorical data:
623623

624-
``Series`` methods like :meth:`Series.value_counts` will use all categories,
624+
``Series`` methods like :meth:`Series.value_counts` will use all categories,
625625
even if some categories are not present in the data:
626626

627627
.. ipython:: python
@@ -666,7 +666,7 @@ that only values already in `categories` can be assigned.
666666
Getting
667667
~~~~~~~
668668

669-
If the slicing operation returns either a ``DataFrame`` or a column of type
669+
If the slicing operation returns either a ``DataFrame`` or a column of type
670670
``Series``, the ``category`` dtype is preserved.
671671

672672
.. ipython:: python
@@ -681,7 +681,7 @@ If the slicing operation returns either a ``DataFrame`` or a column of type
681681
df.loc["h":"j", "cats"]
682682
df[df["cats"] == "b"]
683683
684-
An example where the category type is not preserved is if you take one single
684+
An example where the category type is not preserved is if you take one single
685685
row: the resulting ``Series`` is of dtype ``object``:
686686

687687
.. ipython:: python
@@ -702,7 +702,7 @@ of length "1".
702702
The is in contrast to R's `factor` function, where ``factor(c(1,2,3))[1]``
703703
returns a single value `factor`.
704704

705-
To get a single value ``Series`` of type ``category``, you pass in a list with
705+
To get a single value ``Series`` of type ``category``, you pass in a list with
706706
a single value:
707707

708708
.. ipython:: python
@@ -756,7 +756,7 @@ That means, that the returned values from methods and properties on the accessor
756756
Setting
757757
~~~~~~~
758758

759-
Setting values in a categorical column (or ``Series``) works as long as the
759+
Setting values in a categorical column (or ``Series``) works as long as the
760760
value is included in the `categories`:
761761

762762
.. ipython:: python
@@ -836,9 +836,9 @@ Unioning
836836

837837
.. versionadded:: 0.19.0
838838

839-
If you want to combine categoricals that do not necessarily have the same
839+
If you want to combine categoricals that do not necessarily have the same
840840
categories, the :func:`~pandas.api.types.union_categoricals` function will
841-
combine a list-like of categoricals. The new categories will be the union of
841+
combine a list-like of categoricals. The new categories will be the union of
842842
the categories being combined.
843843

844844
.. ipython:: python
@@ -887,8 +887,8 @@ using the ``ignore_ordered=True`` argument.
887887
b = pd.Categorical(["c", "b", "a"], ordered=True)
888888
union_categoricals([a, b], ignore_order=True)
889889
890-
:func:`~pandas.api.types.union_categoricals` also works with a
891-
``CategoricalIndex``, or ``Series`` containing categorical data, but note that
890+
:func:`~pandas.api.types.union_categoricals` also works with a
891+
``CategoricalIndex``, or ``Series`` containing categorical data, but note that
892892
the resulting array will always be a plain ``Categorical``:
893893

894894
.. ipython:: python
@@ -1179,8 +1179,8 @@ Setting the index will create a ``CategoricalIndex``:
11791179
Side Effects
11801180
~~~~~~~~~~~~
11811181

1182-
Constructing a ``Series`` from a ``Categorical`` will not copy the input
1183-
``Categorical``. This means that changes to the ``Series`` will in most cases
1182+
Constructing a ``Series`` from a ``Categorical`` will not copy the input
1183+
``Categorical``. This means that changes to the ``Series`` will in most cases
11841184
change the original ``Categorical``:
11851185

11861186
.. ipython:: python

doc/source/comparison_with_sas.rst

+14-14
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ String Processing
364364
Length
365365
~~~~~~
366366

367-
SAS determines the length of a character string with the
367+
SAS determines the length of a character string with the
368368
`LENGTHN <https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002284668.htm>`__
369369
and `LENGTHC <https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002283942.htm>`__
370370
functions. ``LENGTHN`` excludes trailing blanks and ``LENGTHC`` includes trailing blanks.
@@ -378,7 +378,7 @@ functions. ``LENGTHN`` excludes trailing blanks and ``LENGTHC`` includes trailin
378378
run;
379379
380380
Python determines the length of a character string with the ``len`` function.
381-
``len`` includes trailing blanks. Use ``len`` and ``rstrip`` to exclude
381+
``len`` includes trailing blanks. Use ``len`` and ``rstrip`` to exclude
382382
trailing blanks.
383383

384384
.. ipython:: python
@@ -390,9 +390,9 @@ trailing blanks.
390390
Find
391391
~~~~
392392

393-
SAS determines the position of a character in a string with the
393+
SAS determines the position of a character in a string with the
394394
`FINDW <https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002978282.htm>`__ function.
395-
``FINDW`` takes the string defined by the first argument and searches for the first position of the substring
395+
``FINDW`` takes the string defined by the first argument and searches for the first position of the substring
396396
you supply as the second argument.
397397

398398
.. code-block:: sas
@@ -402,10 +402,10 @@ you supply as the second argument.
402402
put(FINDW(sex,'ale'));
403403
run;
404404
405-
Python determines the position of a character in a string with the
406-
``find`` function. ``find`` searches for the first position of the
407-
substring. If the substring is found, the function returns its
408-
position. Keep in mind that Python indexes are zero-based and
405+
Python determines the position of a character in a string with the
406+
``find`` function. ``find`` searches for the first position of the
407+
substring. If the substring is found, the function returns its
408+
position. Keep in mind that Python indexes are zero-based and
409409
the function will return -1 if it fails to find the substring.
410410

411411
.. ipython:: python
@@ -416,7 +416,7 @@ the function will return -1 if it fails to find the substring.
416416
Substring
417417
~~~~~~~~~
418418

419-
SAS extracts a substring from a string based on its position with the
419+
SAS extracts a substring from a string based on its position with the
420420
`SUBSTR <https://www2.sas.com/proceedings/sugi25/25/cc/25p088.pdf>`__ function.
421421

422422
.. code-block:: sas
@@ -427,7 +427,7 @@ SAS extracts a substring from a string based on its position with the
427427
run;
428428
429429
With pandas you can use ``[]`` notation to extract a substring
430-
from a string by position locations. Keep in mind that Python
430+
from a string by position locations. Keep in mind that Python
431431
indexes are zero-based.
432432

433433
.. ipython:: python
@@ -439,7 +439,7 @@ Scan
439439
~~~~
440440

441441
The SAS `SCAN <https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000214639.htm>`__
442-
function returns the nth word from a string. The first argument is the string you want to parse and the
442+
function returns the nth word from a string. The first argument is the string you want to parse and the
443443
second argument specifies which word you want to extract.
444444

445445
.. code-block:: sas
@@ -452,10 +452,10 @@ second argument specifies which word you want to extract.
452452
John Smith;
453453
Jane Cook;
454454
;;;
455-
run;
455+
run;
456456
457-
Python extracts a substring from a string based on its text
458-
by using regular expressions. There are much more powerful
457+
Python extracts a substring from a string based on its text
458+
by using regular expressions. There are much more powerful
459459
approaches, but this just shows a simple approach.
460460

461461
.. ipython:: python

doc/source/computation.rst

+12-12
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Statistical Functions
1313
Percent Change
1414
~~~~~~~~~~~~~~
1515

16-
``Series``, ``DataFrame``, and ``Panel`` all have a method
17-
:meth:`~DataFrame.pct_change` to compute the percent change over a given number
18-
of periods (using ``fill_method`` to fill NA/null values *before* computing
16+
``Series``, ``DataFrame``, and ``Panel`` all have a method
17+
:meth:`~DataFrame.pct_change` to compute the percent change over a given number
18+
of periods (using ``fill_method`` to fill NA/null values *before* computing
1919
the percent change).
2020

2121
.. ipython:: python
@@ -35,7 +35,7 @@ the percent change).
3535
Covariance
3636
~~~~~~~~~~
3737

38-
:meth:`Series.cov` can be used to compute covariance between series
38+
:meth:`Series.cov` can be used to compute covariance between series
3939
(excluding missing values).
4040

4141
.. ipython:: python
@@ -44,7 +44,7 @@ Covariance
4444
s2 = pd.Series(np.random.randn(1000))
4545
s1.cov(s2)
4646
47-
Analogously, :meth:`DataFrame.cov` to compute pairwise covariances among the
47+
Analogously, :meth:`DataFrame.cov` to compute pairwise covariances among the
4848
series in the DataFrame, also excluding NA/null values.
4949

5050
.. _computation.covariance.caveats:
@@ -87,7 +87,7 @@ Correlation
8787
~~~~~~~~~~~
8888

8989
Correlation may be computed using the :meth:`~DataFrame.corr` method.
90-
Using the ``method`` parameter, several methods for computing correlations are
90+
Using the ``method`` parameter, several methods for computing correlations are
9191
provided:
9292

9393
.. csv-table::
@@ -158,8 +158,8 @@ compute the correlation based on histogram intersection:
158158
159159
frame.corr(method=histogram_intersection)
160160
161-
A related method :meth:`~DataFrame.corrwith` is implemented on DataFrame to
162-
compute the correlation between like-labeled Series contained in different
161+
A related method :meth:`~DataFrame.corrwith` is implemented on DataFrame to
162+
compute the correlation between like-labeled Series contained in different
163163
DataFrame objects.
164164

165165
.. ipython:: python
@@ -176,7 +176,7 @@ DataFrame objects.
176176
Data ranking
177177
~~~~~~~~~~~~
178178

179-
The :meth:`~Series.rank` method produces a data ranking with ties being
179+
The :meth:`~Series.rank` method produces a data ranking with ties being
180180
assigned the mean of the ranks (by default) for the group:
181181

182182
.. ipython:: python
@@ -185,8 +185,8 @@ assigned the mean of the ranks (by default) for the group:
185185
s['d'] = s['b'] # so there's a tie
186186
s.rank()
187187
188-
:meth:`~DataFrame.rank` is also a DataFrame method and can rank either the rows
189-
(``axis=0``) or the columns (``axis=1``). ``NaN`` values are excluded from the
188+
:meth:`~DataFrame.rank` is also a DataFrame method and can rank either the rows
189+
(``axis=0``) or the columns (``axis=1``). ``NaN`` values are excluded from the
190190
ranking.
191191

192192
.. ipython:: python
@@ -637,7 +637,7 @@ perform multiple computations on the data. These operations are similar to the :
637637
r = dfa.rolling(window=60, min_periods=1)
638638
r
639639
640-
We can aggregate by passing a function to the entire DataFrame, or select a
640+
We can aggregate by passing a function to the entire DataFrame, or select a
641641
Series (or multiple Series) via standard ``__getitem__``.
642642

643643
.. ipython:: python

0 commit comments

Comments
 (0)