diff options
| author | Sista Seetaram <hanumaseetaram@gmail.com> | 2021-10-06 17:10:10 +0530 |
|---|---|---|
| committer | Sista Seetaram <hanumaseetaram@gmail.com> | 2021-10-06 17:10:10 +0530 |
| commit | de4c233008e8d122ba6690ec39cf743fcb4115b7 (patch) | |
| tree | 8ea3eabd3680271db8629bf6ba9ab1a13e7bfb8b /numpy | |
| parent | 13765686623a28c3cb25c86b6b4c0867ff27fd32 (diff) | |
| download | numpy-de4c233008e8d122ba6690ec39cf743fcb4115b7.tar.gz | |
added-suggestion-to#20047
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/lib/function_base.py | 5 |
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 |
