Skip to content

DOC: use new numpy doc url #34091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/source/development/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ version control to allow many people to work together on the project.
Some great resources for learning Git:

* the `GitHub help pages <https://help.github.com/>`_.
* the `NumPy's documentation <https://docs.scipy.org/doc/numpy/dev/index.html>`_.
* the `NumPy's documentation <https://numpy.org/doc/stable/dev/index.html>`_.
* Matthew Brett's `Pydagogue <https://matthew-brett.github.com/pydagogue/>`_.

Getting started with Git
Expand Down Expand Up @@ -974,7 +974,7 @@ it is worth getting in the habit of writing tests ahead of time so this is never
Like many packages, pandas uses `pytest
<https://docs.pytest.org/en/latest/>`_ and the convenient
extensions in `numpy.testing
<https://docs.scipy.org/doc/numpy/reference/routines.testing.html>`_.
<https://numpy.org/doc/stable/reference/routines.testing.html>`_.

.. note::

Expand Down
2 changes: 1 addition & 1 deletion doc/source/development/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ and re-boxes it if necessary.

If applicable, we highly recommend that you implement ``__array_ufunc__`` in your
extension array to avoid coercion to an ndarray. See
`the numpy documentation <https://docs.scipy.org/doc/numpy/reference/generated/numpy.lib.mixins.NDArrayOperatorsMixin.html>`__
`the numpy documentation <https://numpy.org/doc/stable/reference/generated/numpy.lib.mixins.NDArrayOperatorsMixin.html>`__
for an example.

As part of your implementation, we require that you defer to pandas when a pandas
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2385,7 +2385,7 @@ For example, to select ``bool`` columns:
df.select_dtypes(include=[bool])

You can also pass the name of a dtype in the `NumPy dtype hierarchy
<https://docs.scipy.org/doc/numpy/reference/arrays.scalars.html>`__:
<https://numpy.org/doc/stable/reference/arrays.scalars.html>`__:

.. ipython:: python

Expand Down
6 changes: 3 additions & 3 deletions doc/source/user_guide/dsintro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ pandas object. Like Series, DataFrame accepts many different kinds of input:
* Dict of 1D ndarrays, lists, dicts, or Series
* 2-D numpy.ndarray
* `Structured or record
<https://docs.scipy.org/doc/numpy/user/basics.rec.html>`__ ndarray
<https://numpy.org/doc/stable/user/basics.rec.html>`__ ndarray
* A ``Series``
* Another ``DataFrame``

Expand Down Expand Up @@ -632,7 +632,7 @@ union of the column and row labels.

When doing an operation between DataFrame and Series, the default behavior is
to align the Series **index** on the DataFrame **columns**, thus `broadcasting
<https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html>`__
<https://numpy.org/doc/stable/user/basics.broadcasting.html>`__
row-wise. For example:

.. ipython:: python
Expand Down Expand Up @@ -718,7 +718,7 @@ indexing semantics and data model are quite different in places from an n-dimens
array.

:class:`Series` implements ``__array_ufunc__``, which allows it to work with NumPy's
`universal functions <https://docs.scipy.org/doc/numpy/reference/ufuncs.html>`_.
`universal functions <https://numpy.org/doc/stable/reference/ufuncs.html>`_.

The ufunc is applied to the underlying array in a Series.

Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/gotchas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -339,5 +339,5 @@ constructors using something similar to the following:
s = pd.Series(newx)

See `the NumPy documentation on byte order
<https://docs.scipy.org/doc/numpy/user/basics.byteswapping.html>`__ for more
<https://numpy.org/doc/stable/user/basics.byteswapping.html>`__ for more
details.
2 changes: 1 addition & 1 deletion doc/source/user_guide/sparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ See :ref:`api.frame.sparse` for more.
Sparse calculation
------------------

You can apply NumPy `ufuncs <https://docs.scipy.org/doc/numpy/reference/ufuncs.html>`_
You can apply NumPy `ufuncs <https://numpy.org/doc/stable/reference/ufuncs.html>`_
to ``SparseArray`` and get a ``SparseArray`` as a result.

.. ipython:: python
Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.19.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ Fine-grained NumPy errstate

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`)

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 <http://docs.scipy.org/doc/numpy/reference/generated/numpy.errstate.html>`__ around the source of the ``RuntimeWarning`` to control how these conditions are handled.
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.

.. _whatsnew_0190.get_dummies_dtypes:

Expand Down
3 changes: 1 addition & 2 deletions pandas/_libs/testing.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ cdef bint is_dictlike(obj):

cdef bint decimal_almost_equal(double desired, double actual, int decimal):
# Code from
# http://docs.scipy.org/doc/numpy/reference/generated
# /numpy.testing.assert_almost_equal.html
# https://numpy.org/doc/stable/reference/generated/numpy.testing.assert_almost_equal.html
return abs(desired - actual) < (0.5 * 10.0 ** -decimal)


Expand Down
3 changes: 1 addition & 2 deletions pandas/core/arrays/numpy_.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ def __array__(self, dtype=None) -> np.ndarray:

def __array_ufunc__(self, ufunc, method: str, *inputs, **kwargs):
# Lightly modified version of
# https://docs.scipy.org/doc/numpy-1.15.1/reference/generated/\
# numpy.lib.mixins.NDArrayOperatorsMixin.html
# https://numpy.org/doc/stable/reference/generated/numpy.lib.mixins.NDArrayOperatorsMixin.html
# The primary modification is not boxing scalar return values
# in PandasArray, since pandas' ExtensionArrays are 1-d.
out = kwargs.get("out", ())
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3360,7 +3360,7 @@ def select_dtypes(self, include=None, exclude=None) -> "DataFrame":
* To select strings you must use the ``object`` dtype, but note that
this will return *all* object dtype columns
* See the `numpy dtype hierarchy
<https://docs.scipy.org/doc/numpy/reference/arrays.scalars.html>`__
<https://numpy.org/doc/stable/reference/arrays.scalars.html>`__
* To select datetimes, use ``np.datetime64``, ``'datetime'`` or
``'datetime64'``
* To select timedeltas, use ``np.timedelta64``, ``'timedelta'`` or
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/multi/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def test_map_dictlike(idx, mapper):
)
def test_numpy_ufuncs(idx, func):
# test ufuncs of numpy. see:
# https://docs.scipy.org/doc/numpy/reference/ufuncs.html
# https://numpy.org/doc/stable/reference/ufuncs.html

if _np_version_under1p17:
expected_exception = AttributeError
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/indexes/test_numpy_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
)
def test_numpy_ufuncs_basic(indices, func):
# test ufuncs of numpy, see:
# https://docs.scipy.org/doc/numpy/reference/ufuncs.html
# https://numpy.org/doc/stable/reference/ufuncs.html

idx = indices
if isinstance(idx, DatetimeIndexOpsMixin):
Expand Down Expand Up @@ -77,7 +77,7 @@ def test_numpy_ufuncs_basic(indices, func):
)
def test_numpy_ufuncs_other(indices, func):
# test ufuncs of numpy, see:
# https://docs.scipy.org/doc/numpy/reference/ufuncs.html
# https://numpy.org/doc/stable/reference/ufuncs.html

idx = indices
if isinstance(idx, (DatetimeIndex, TimedeltaIndex)):
Expand Down
2 changes: 1 addition & 1 deletion web/pandas/community/blog/extension-arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ partners][partners] involved in the pandas community.
[IntegerArray]: http://pandas.pydata.org/pandas-docs/version/0.24/reference/api/pandas.arrays.IntegerArray.html
[fletcher]: https://github.com/xhochy/fletcher
[arrow]: https://arrow.apache.org
[ufunc]: https://docs.scipy.org/doc/numpy-1.13.0/neps/ufunc-overrides.html
[ufunc]: https://numpy.org/neps/nep-0013-ufunc-overrides.html
[nep18]: https://www.numpy.org/neps/nep-0018-array-function-protocol.html
[ml]: https://mail.python.org/mailman/listinfo/pandas-dev
[twitter]: https://twitter.com/pandas_dev
Expand Down