|
@ -1716,14 +1716,14 @@ import numpy as np |
|
|
<array> = np.random.randint(from_inclusive, to_exclusive, <shape>) |
|
|
<array> = np.random.randint(from_inclusive, to_exclusive, <shape>) |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
#### Shape is a tuple of dimension sizes: |
|
|
|
|
|
|
|
|
#### Shape is a tuple of dimension sizes. |
|
|
```python |
|
|
```python |
|
|
<array>.shape = <shape> |
|
|
<array>.shape = <shape> |
|
|
<view> = <array>.reshape(<shape>) |
|
|
<view> = <array>.reshape(<shape>) |
|
|
<view> = np.broadcast_to(<array>, <shape>) |
|
|
<view> = np.broadcast_to(<array>, <shape>) |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
#### Axis is an index of dimension that gets collapsed: |
|
|
|
|
|
|
|
|
#### Axis is an index of dimension that gets collapsed. |
|
|
```python |
|
|
```python |
|
|
<array> = <array>.sum(<axis>) |
|
|
<array> = <array>.sum(<axis>) |
|
|
<array> = <array>.argmin(<axis>) |
|
|
<array> = <array>.argmin(<axis>) |
|
|