summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/lib/function_base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index a15687e3a..67563873b 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -781,10 +781,13 @@ def copy(a, order='K', subok=False):
Note that, np.copy clears previously set WRITEABLE=False flag.
- >>> a = np.array([1,2,3])
+ >>> a = np.array([1, 2, 3])
>>> a.flags["WRITEABLE"] = False
>>> b = np.copy(a)
+ >>> b.flags["WRITEABLE"]
+ True
>>> b[0] = 3
+ >>> b
array([3, 2, 3])
Note that np.copy is a shallow copy and will not copy object