summaryrefslogtreecommitdiff
path: root/doc/source/reference/c-api
diff options
context:
space:
mode:
authorRoss Barnowski <rossbar@caltech.edu>2023-01-27 23:25:01 -0800
committerGitHub <noreply@github.com>2023-01-27 23:25:01 -0800
commit1b9d68cf3dc802e42930d02a2ff7d880b632cfd4 (patch)
tree5a6110118e54762d2c7d2c22220a1c4e74cf850e /doc/source/reference/c-api
parent2aa0bf6973b709724624db8e8a51d8efbdeb5d22 (diff)
downloadnumpy-1b9d68cf3dc802e42930d02a2ff7d880b632cfd4.tar.gz
DOC: Fix broken link in C-API array docs (#23117)
Add link to array iterator example Co-authored-by: arunkumarkota <arunkumarkota@gmail.com> Co-authored-by: Arun Kota <arunkota@Aruns-iMac.local>
Diffstat (limited to 'doc/source/reference/c-api')
-rw-r--r--doc/source/reference/c-api/array.rst6
-rw-r--r--doc/source/reference/c-api/iterator.rst4
2 files changed, 6 insertions, 4 deletions
diff --git a/doc/source/reference/c-api/array.rst b/doc/source/reference/c-api/array.rst
index 8772b494c..6651a4760 100644
--- a/doc/source/reference/c-api/array.rst
+++ b/doc/source/reference/c-api/array.rst
@@ -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)
diff --git a/doc/source/reference/c-api/iterator.rst b/doc/source/reference/c-api/iterator.rst
index 09c61e5fc..92e3e435b 100644
--- a/doc/source/reference/c-api/iterator.rst
+++ b/doc/source/reference/c-api/iterator.rst
@@ -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