Skip to content

Commit 0793a86

Browse files
author
Yuki K
authored
DOC: Fix some incorrectly formatted documents (numpy#24287)
Fix rst formatting to correct rendered html
1 parent e41180d commit 0793a86

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

doc/source/reference/c-api/array.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,8 +1630,8 @@ Conversion
16301630
<https://docs.python.org/3/c-api/intro.html?reference-count-details>`_
16311631
to `PyArray_Descr` and returns a new array of the given `dtype` using
16321632
the data in the current array at a specified `offset` in bytes. The
1633-
`offset` plus the itemsize of the new array type must be less than ``self
1634-
->descr->elsize`` or an error is raised. The same shape and strides
1633+
`offset` plus the itemsize of the new array type must be less than
1634+
``self->descr->elsize`` or an error is raised. The same shape and strides
16351635
as the original array are used. Therefore, this function has the
16361636
effect of returning a field from a structured array. But, it can also
16371637
be used to select specific bytes or groups of bytes from any array

doc/source/user/how-to-index.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ Non-zero elements
193193
Use :meth:`nonzero` to get a tuple of array indices of non-zero elements
194194
corresponding to every dimension::
195195

196-
>>> z = np.array([[1, 2, 3, 0], [0, 0, 5, 3], [4, 6, 0, 0]])
197-
>>> z
198-
array([[1, 2, 3, 0],
199-
[0, 0, 5, 3],
200-
[4, 6, 0, 0]])
201-
>>> np.nonzero(z)
202-
(array([0, 0, 0, 1, 1, 2, 2]), array([0, 1, 2, 2, 3, 0, 1]))
196+
>>> z = np.array([[1, 2, 3, 0], [0, 0, 5, 3], [4, 6, 0, 0]])
197+
>>> z
198+
array([[1, 2, 3, 0],
199+
[0, 0, 5, 3],
200+
[4, 6, 0, 0]])
201+
>>> np.nonzero(z)
202+
(array([0, 0, 0, 1, 1, 2, 2]), array([0, 1, 2, 2, 3, 0, 1]))
203203

204204
Use :meth:`flatnonzero` to fetch indices of elements that are non-zero in
205205
the flattened version of the ndarray::

doc/source/user/how-to-io.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Whitespace-delimited
9696
:func:`numpy.genfromtxt` can also parse whitespace-delimited data files
9797
that have missing values if
9898

99-
* **Each field has a fixed width**: Use the width as the `delimiter` argument.
99+
* **Each field has a fixed width**: Use the width as the `delimiter` argument.::
100100

101101
# File with width=4. The data does not have to be justified (for example,
102102
# the 2 in row 1), the last column can be less than width (for example, the 6
@@ -154,7 +154,7 @@ that have missing values if
154154
* **The delimiter whitespace character is different from the whitespace that
155155
indicates missing data**. For instance, if columns are delimited by ``\t``,
156156
then missing data will be recognized if it consists of one
157-
or more spaces.
157+
or more spaces.::
158158

159159
>>> with open("tabs.txt", "r") as f:
160160
... data = (f.read())

numpy/lib/index_tricks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ class MGridClass(nd_grid):
225225
226226
Returns
227227
-------
228-
mesh-grid `ndarrays` all of the same dimensions
228+
mesh-grid
229+
`ndarrays` all of the same dimensions
229230
230231
See Also
231232
--------

0 commit comments

Comments
 (0)