Skip to content

Commit 2b4563a

Browse files
committed
DOC: Added note about base attribute
1 parent 1624059 commit 2b4563a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/source/user/basics.copies.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ How to tell if the array is a view or a copy
128128

129129
The :attr:`base <.ndarray.base>` attribute of the ndarray makes it easy
130130
to tell if an array is a view or a copy. The base attribute of a view returns
131-
the original array while it returns ``None`` for a copy.
131+
the original array while it returns ``None`` for a copy.
132132

133133
>>> x = np.arange(9)
134134
>>> x
@@ -146,3 +146,7 @@ the original array while it returns ``None`` for a copy.
146146
[3, 4, 5]])
147147
>>> z.base is None # advanced indexing creates a copy
148148
True
149+
150+
Note that the ``base`` attribute should not be used to determine
151+
if an ndarray object is *new*; only if it is a view or a copy
152+
of another ndarray.

0 commit comments

Comments
 (0)