diff options
| -rw-r--r-- | numpy/lib/function_base.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 3ca566f73..a15687e3a 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -779,6 +779,14 @@ def copy(a, order='K', subok=False): >>> x[0] == z[0] False + Note that, np.copy clears previously set WRITEABLE=False flag. + + >>> a = np.array([1,2,3]) + >>> a.flags["WRITEABLE"] = False + >>> b = np.copy(a) + >>> b[0] = 3 + array([3, 2, 3]) + Note that np.copy is a shallow copy and will not copy object elements within arrays. This is mainly important for arrays containing Python objects. The new array will contain the |
