From 93ad463b9cc7999ad7845494f202eb7fdc3acf5a Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Thu, 14 Dec 2023 17:33:39 +0100 Subject: [PATCH] Update README.md Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com> --- numpy/slices_views/README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/numpy/slices_views/README.md b/numpy/slices_views/README.md index 95384f2..b6299b2 100644 --- a/numpy/slices_views/README.md +++ b/numpy/slices_views/README.md @@ -140,9 +140,14 @@ a and b are not independent. If I change b this changes automatically a too. **I Operations which are known to create views are: * Slicing * Reshaping -* ndarray.view() -* Transposition +* Transposition (e.g. b=a.T) +* [ndarray.view()](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.view.html) +```python +ndarray.view([dtype][, type]) +``` + +> New view of array with the same data * Using [start:stop:step] for slicing out segments results in a view. b = a[:-1] * A simple assignment keeps a view as a view.​ e.g. b = a