From 1b9d68cf3dc802e42930d02a2ff7d880b632cfd4 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Fri, 27 Jan 2023 23:25:01 -0800 Subject: DOC: Fix broken link in C-API array docs (#23117) Add link to array iterator example Co-authored-by: arunkumarkota Co-authored-by: Arun Kota --- doc/source/reference/c-api/array.rst | 6 +++--- doc/source/reference/c-api/iterator.rst | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'doc/source/reference/c-api') 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 ` 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 -- cgit v1.2.1