Skip to content

Commit 7823d42

Browse files
Remove ambiguity in docs for ndarray.byteswap()
This fixes numpy#27628. Thanks to @Shezeeblanka for pointing out the potential ambiguity in the documentation of numpy.ndarray.byteswap(). This commit explicitly mentions the datatype of the array A so that running the code snippet would yield reproducible results.
1 parent 88a6a00 commit 7823d42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numpy/_core/_add_newdocs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3310,7 +3310,7 @@
33103310
``A.view(A.dtype.newbyteorder()).byteswap()`` produces an array with
33113311
the same values but different representation in memory
33123312
3313-
>>> A = np.array([1, 2, 3])
3313+
>>> A = np.array([1, 2, 3],dtype=np.int64)
33143314
>>> A.view(np.uint8)
33153315
array([1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
33163316
0, 0], dtype=uint8)

0 commit comments

Comments
 (0)