Update README.md

Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
David Rotermund 2023-12-19 12:23:49 +01:00 committed by GitHub
parent 1b91afabf2
commit f13dc12ab0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -258,3 +258,38 @@ plt.show()
**Note the matrix multiplication @**
![image5](image5.png)
## [numpy.indices](https://numpy.org/doc/stable/reference/generated/numpy.indices.html)
{: .topic-optional}
This is an optional topic!
```python
numpy.indices(dimensions, dtype=<class 'int'>, sparse=False)
```
> Return an array representing the indices of a grid.
>
> Compute an array where the subarrays contain index values 0, 1, … varying only along the corresponding axis.
```python
import numpy as np
a, b = np.indices((3,4))
print(a)
print()
print(b)
```
Output:
```python
[[0 0 0 0]
[1 1 1 1]
[2 2 2 2]]
[[0 1 2 3]
[0 1 2 3]
[0 1 2 3]]
```