Update README.md

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

View file

@ -55,6 +55,13 @@ numpy.unravel_index(indices, shape, order='C')
> Converts a flat index or array of flat indices into a tuple of coordinate arrays. > Converts a flat index or array of flat indices into a tuple of coordinate arrays.
```python
import numpy as np
idx = np.ravel_multi_index(([0, 1, 2], [0, 1, 1]), dims=(3, 2))
print(idx) # -> [0 3 5]
a, b = np.unravel_index(idx, shape=(3, 2))
print(a) # -> [0 1 2]
print(b) # -> [0 1 1]
```