Merge pull request #233 from KnightSnape/master

Use default_rng() instead of np.random.random in Exercise #12
This commit is contained in:
Nicolas P. Rougier 2025-05-09 09:35:58 +02:00 committed by GitHub
commit 2b81a8eb25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,6 +96,15 @@ print(Z)
Z = np.random.random((3,3,3)) Z = np.random.random((3,3,3))
print(Z) print(Z)
``` ```
`hint: np.random.default_rng().random`
```python
# Author: KnightSnape
rng = np.random.default_rng()
Z = rng.random((3, 3, 3))
print(Z)
```
#### 13. Create a 10x10 array with random values and find the minimum and maximum values (★☆☆) #### 13. Create a 10x10 array with random values and find the minimum and maximum values (★☆☆)
`hint: min, max` `hint: min, max`