mirror of
https://github.com/davrot/pytutorial.git
synced 2025-04-18 21:26:41 +02:00
Update README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
5ff6611020
commit
9d3d36c23d
1 changed files with 11 additions and 0 deletions
|
@ -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))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue