From 9d3d36c23dc90336648d1c4d60410815f4779b41 Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Thu, 14 Dec 2023 18:27:32 +0100 Subject: [PATCH] Update README.md Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com> --- numpy/advanced_indexing/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/numpy/advanced_indexing/README.md b/numpy/advanced_indexing/README.md index 1df4108..325fd07 100644 --- a/numpy/advanced_indexing/README.md +++ b/numpy/advanced_indexing/README.md @@ -173,6 +173,17 @@ A combination of indexing and slicing can be done but requires some thought. Oth ```python import numpy as np +a = np.arange(1, 28).reshape(3, 3, 3) +idx = [[1, 1], [1, 1]] + +print(a[:, idx, :].shape) # -> (3, 2, 2, 3) +``` + +You want another example? + +```python +import numpy as np + a = np.empty((10, 20, 30, 40, 50))