Skip to content

Commit 5d9b334

Browse files
committed
DOC: reintroduce contextual pandas tokens
1 parent 318751f commit 5d9b334

File tree

10 files changed

+17
-17
lines changed

10 files changed

+17
-17
lines changed

doc/source/development/contributing_docstring.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ be added with blank lines before and after them.
616616

617617
The way to present examples is as follows:
618618

619-
1. Import required libraries (except ``numpy`` and pandas)
619+
1. Import required libraries (except ``numpy`` and ``pandas``)
620620

621621
2. Create the data required for the example
622622

doc/source/development/developer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ where ``KeyValue`` is
3333
}
3434
3535
So that a ``pandas.DataFrame`` can be faithfully reconstructed, we store a
36-
pandas metadata key in the ``FileMetaData`` with the value stored as :
36+
``pandas`` metadata key in the ``FileMetaData`` with the value stored as :
3737

3838
.. code-block:: text
3939

doc/source/development/extending.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ your ``MyExtensionArray`` class, as follows:
188188
189189
.. note::
190190

191-
Since pandas automatically calls the underlying operator on each
191+
Since ``pandas`` automatically calls the underlying operator on each
192192
element one-by-one, this might not be as performant as implementing your own
193193
version of the associated operators directly on the ``ExtensionArray``.
194194

@@ -303,7 +303,7 @@ dtypes included in pandas, and ensure roundtrip to pyarrow and the Parquet file
303303
Subclassing pandas data structures
304304
----------------------------------
305305

306-
.. warning:: There are some easier alternatives before considering subclassing pandas data structures.
306+
.. warning:: There are some easier alternatives before considering subclassing ``pandas`` data structures.
307307

308308
1. Extensible method chains with :ref:`pipe <basics.pipe>`
309309

@@ -313,7 +313,7 @@ Subclassing pandas data structures
313313

314314
4. Extending by :ref:`extension type <extending.extension-types>`
315315

316-
This section describes how to subclass pandas data structures to meet more specific needs. There are two points that need attention:
316+
This section describes how to subclass ``pandas`` data structures to meet more specific needs. There are two points that need attention:
317317

318318
1. Override constructor properties.
319319
2. Define original properties
@@ -327,15 +327,15 @@ Override constructor properties
327327

328328
Each data structure has several *constructor properties* for returning a new
329329
data structure as the result of an operation. By overriding these properties,
330-
you can retain subclasses through pandas data manipulations.
330+
you can retain subclasses through ``pandas`` data manipulations.
331331

332332
There are 3 constructor properties to be defined:
333333

334334
* ``_constructor``: Used when a manipulation result has the same dimensions as the original.
335335
* ``_constructor_sliced``: Used when a manipulation result has one lower dimension(s) as the original, such as ``DataFrame`` single columns slicing.
336336
* ``_constructor_expanddim``: Used when a manipulation result has one higher dimension as the original, such as ``Series.to_frame()``.
337337

338-
Following table shows how pandas data structures define constructor properties by default.
338+
Following table shows how ``pandas`` data structures define constructor properties by default.
339339

340340
=========================== ======================= =============
341341
Property Attributes ``Series`` ``DataFrame``
@@ -411,7 +411,7 @@ Below example shows how to define ``SubclassedSeries`` and ``SubclassedDataFrame
411411
Define original properties
412412
^^^^^^^^^^^^^^^^^^^^^^^^^^
413413

414-
To let original data structures have additional properties, you should let pandas know what properties are added. pandas maps unknown properties to data names overriding ``__getattribute__``. Defining original properties can be done in one of 2 ways:
414+
To let original data structures have additional properties, you should let ``pandas`` know what properties are added. ``pandas`` maps unknown properties to data names overriding ``__getattribute__``. Defining original properties can be done in one of 2 ways:
415415

416416
1. Define ``_internal_names`` and ``_internal_names_set`` for temporary properties which WILL NOT be passed to manipulation results.
417417
2. Define ``_metadata`` for normal properties which will be passed to manipulation results.

doc/source/user_guide/io.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3365,7 +3365,7 @@ All pandas objects are equipped with ``to_pickle`` methods which use Python's
33653365
df
33663366
df.to_pickle("foo.pkl")
33673367
3368-
The ``read_pickle`` function in the pandas namespace can be used to load
3368+
The ``read_pickle`` function in the ``pandas`` namespace can be used to load
33693369
any pickled pandas object (or any other pickled object) from file:
33703370

33713371

doc/source/user_guide/options.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You can get/set options directly as attributes of the top-level ``options`` attr
2222
pd.options.display.max_rows = 999
2323
pd.options.display.max_rows
2424
25-
The API is composed of 5 relevant functions, available directly from the pandas
25+
The API is composed of 5 relevant functions, available directly from the ``pandas``
2626
namespace:
2727

2828
* :func:`~pandas.get_option` / :func:`~pandas.set_option` - get/set the value of a single option.

doc/source/whatsnew/v0.12.0.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ API changes
1818
~~~~~~~~~~~
1919

2020
- The I/O API is now much more consistent with a set of top level ``reader`` functions
21-
accessed like ``pd.read_csv()`` that generally return a pandas object.
21+
accessed like ``pd.read_csv()`` that generally return a ``pandas`` object.
2222

2323
* ``read_csv``
2424
* ``read_excel``
@@ -179,7 +179,7 @@ API changes
179179
``bs4`` + ``html5lib`` when lxml fails to parse. a list of parsers to try
180180
until success is also valid
181181

182-
- The internal pandas class hierarchy has changed (slightly). The
182+
- The internal ``pandas`` class hierarchy has changed (slightly). The
183183
previous ``PandasObject`` now is called ``PandasContainer`` and a new
184184
``PandasObject`` has become the base class for ``PandasContainer`` as well
185185
as ``Index``, ``Categorical``, ``GroupBy``, ``SparseList``, and

doc/source/whatsnew/v0.13.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ API changes
5757
filter, map and zip, plus other necessary elements for Python 3
5858
compatibility. ``lmap``, ``lzip``, ``lrange`` and ``lfilter`` all produce
5959
lists instead of iterators, for compatibility with ``numpy``, subscripting
60-
and pandas constructors.(:issue:`4384`, :issue:`4375`, :issue:`4372`)
60+
and ``pandas`` constructors.(:issue:`4384`, :issue:`4375`, :issue:`4372`)
6161
- ``Series.get`` with negative indexers now returns the same as ``[]`` (:issue:`4390`)
6262
- Changes to how ``Index`` and ``MultiIndex`` handle metadata (``levels``,
6363
``labels``, and ``names``) (:issue:`4039`):

doc/source/whatsnew/v0.18.1.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,9 @@ NumPy function compatibility
381381
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
382382

383383
Compatibility between pandas array-like methods (e.g. ``sum`` and ``take``) and their ``numpy``
384-
counterparts has been greatly increased by augmenting the signatures of the pandas methods so
384+
counterparts has been greatly increased by augmenting the signatures of the ``pandas`` methods so
385385
as to accept arguments that can be passed in from ``numpy``, even if they are not necessarily
386-
used in the pandas implementation (:issue:`12644`, :issue:`12638`, :issue:`12687`)
386+
used in the ``pandas`` implementation (:issue:`12644`, :issue:`12638`, :issue:`12687`)
387387

388388
- ``.searchsorted()`` for ``Index`` and ``TimedeltaIndex`` now accept a ``sorter`` argument to maintain compatibility with numpy's ``searchsorted`` function (:issue:`12238`)
389389
- Bug in numpy compatibility of ``np.round()`` on a ``Series`` (:issue:`12600`)

doc/source/whatsnew/v0.19.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ Google BigQuery enhancements
404404
Fine-grained NumPy errstate
405405
^^^^^^^^^^^^^^^^^^^^^^^^^^^
406406

407-
Previous versions of pandas would permanently silence numpy's ufunc error handling when pandas was imported. pandas did this in order to silence the warnings that would arise from using numpy ufuncs on missing data, which are usually represented as ``NaN`` s. Unfortunately, this silenced legitimate warnings arising in non-pandas code in the application. Starting with 0.19.0, pandas will use the ``numpy.errstate`` context manager to silence these warnings in a more fine-grained manner, only around where these operations are actually used in the pandas code base. (:issue:`13109`, :issue:`13145`)
407+
Previous versions of pandas would permanently silence numpy's ufunc error handling when ``pandas`` was imported. pandas did this in order to silence the warnings that would arise from using numpy ufuncs on missing data, which are usually represented as ``NaN`` s. Unfortunately, this silenced legitimate warnings arising in non-pandas code in the application. Starting with 0.19.0, pandas will use the ``numpy.errstate`` context manager to silence these warnings in a more fine-grained manner, only around where these operations are actually used in the pandas code base. (:issue:`13109`, :issue:`13145`)
408408

409409
After upgrading pandas, you may see *new* ``RuntimeWarnings`` being issued from your code. These are likely legitimate, and the underlying cause likely existed in the code when using previous versions of pandas that simply silenced the warning. Use `numpy.errstate <https://numpy.org/doc/stable/reference/generated/numpy.errstate.html>`__ around the source of the ``RuntimeWarning`` to control how these conditions are handled.
410410

doc/source/whatsnew/v0.20.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,7 @@ Other deprecations
15431543
- ``TimedeltaIndex.searchsorted()``, ``DatetimeIndex.searchsorted()``, and ``PeriodIndex.searchsorted()`` have deprecated the ``key`` parameter in favor of ``value`` (:issue:`12662`)
15441544
- ``DataFrame.astype()`` has deprecated the ``raise_on_error`` parameter in favor of ``errors`` (:issue:`14878`)
15451545
- ``Series.sortlevel`` and ``DataFrame.sortlevel`` have been deprecated in favor of ``Series.sort_index`` and ``DataFrame.sort_index`` (:issue:`15099`)
1546-
- importing ``concat`` from ``pandas.tools.merge`` has been deprecated in favor of imports from the pandas namespace. This should only affect explicit imports (:issue:`15358`)
1546+
- importing ``concat`` from ``pandas.tools.merge`` has been deprecated in favor of imports from the ``pandas`` namespace. This should only affect explicit imports (:issue:`15358`)
15471547
- ``Series/DataFrame/Panel.consolidate()`` been deprecated as a public method. (:issue:`15483`)
15481548
- The ``as_indexer`` keyword of ``Series.str.match()`` has been deprecated (ignored keyword) (:issue:`15257`).
15491549
- The following top-level pandas functions have been deprecated and will be removed in a future version (:issue:`13790`, :issue:`15940`)

0 commit comments

Comments
 (0)