Skip to content

Commit 025a270

Browse files
authored
DOC: Mention that c is reassigned but still points to a (quickstart) (numpy#27347)
* Mention that c is reassigned but still points to a * Add internal link to copies and views page in documentation
1 parent 9558f8d commit 025a270

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/source/user/quickstart.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ creates a new array object that looks at the same data.
881881
>>> c.flags.owndata
882882
False
883883
>>>
884-
>>> c = c.reshape((2, 6)) # a's shape doesn't change
884+
>>> c = c.reshape((2, 6)) # a's shape doesn't change, reassigned c is still a view of a
885885
>>> a.shape
886886
(3, 4)
887887
>>> c[0, 4] = 1234 # a's data changes
@@ -929,6 +929,8 @@ a small fraction of ``a``, a deep copy should be made when constructing ``b`` wi
929929
If ``b = a[:100]`` is used instead, ``a`` is referenced by ``b`` and will persist in memory
930930
even if ``del a`` is executed.
931931

932+
See also :ref:`basics.copies-and-views`.
933+
932934
Functions and methods overview
933935
------------------------------
934936

0 commit comments

Comments
 (0)