Skip to content

Commit

Permalink
DOC: Fix broken link in C-API array docs (numpy#23117)
Browse files Browse the repository at this point in the history
Add link to array iterator example

Co-authored-by: arunkumarkota <[email protected]>
Co-authored-by: Arun Kota <[email protected]>
  • Loading branch information
3 people authored Jan 28, 2023
1 parent 2aa0bf6 commit 1b9d68c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions doc/source/reference/c-api/array.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2475,9 +2475,9 @@ As of NumPy 1.6.0, these array iterators are superseded by
the new array iterator, :c:type:`NpyIter`.
An array iterator is a simple way to access the elements of an
N-dimensional array quickly and efficiently. Section `2
<#sec-array-iterator>`__ provides more description and examples of
this useful approach to looping over an array.
N-dimensional array quickly and efficiently, as seen in :ref:`the
example <iteration-example>` which provides more description
of this useful approach to looping over an array from C.
.. c:function:: PyObject* PyArray_IterNew(PyObject* arr)
Expand Down
4 changes: 3 additions & 1 deletion doc/source/reference/c-api/iterator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ which may be of interest for those using this C API. In many instances,
testing out ideas by creating the iterator in Python is a good idea
before writing the C iteration code.

.. _iteration-example:

Iteration Example
------------------------
-----------------

The best way to become familiar with the iterator is to look at its
usage within the NumPy codebase itself. For example, here is a slightly
Expand Down

0 comments on commit 1b9d68c

Please sign in to comment.