File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1325,9 +1325,7 @@ ValueError: malformed node or string
1325
1325
import ast
1326
1326
from ast import Num, BinOp, UnaryOp
1327
1327
import operator as op
1328
- ```
1329
1328
1330
- ``` python
1331
1329
legal_operators = {ast.Add: op.add,
1332
1330
ast.Sub: op.sub,
1333
1331
ast.Mult: op.mul,
@@ -1718,15 +1716,17 @@ import numpy as np
1718
1716
< array> = np.random.randint(from_inclusive, to_exclusive, < shape> )
1719
1717
```
1720
1718
1719
+ #### Shape is a tuple of dimension sizes:
1721
1720
``` python
1722
- < array> .shape = < shape> # Shape is a tuple of dimension sizes.
1723
- < view> = < array> .reshape(< shape> )
1724
- < view> = np.broadcast_to(< array> , < shape> )
1721
+ < array> .shape = < shape>
1722
+ < view> = < array> .reshape(< shape> )
1723
+ < view> = np.broadcast_to(< array> , < shape> )
1725
1724
```
1726
1725
1726
+ #### Axis is an index of dimension that gets collapsed:
1727
1727
``` python
1728
- < el_or_array > = < array> .sum([ < axis> ]) # Axis is an index of dimension that gets collapsed.
1729
- < el_or_array > = < array> .argmin([ < axis> ]) # Returns index/es of smallest element/s.
1728
+ < array > = < array> .sum(< axis> )
1729
+ < array > = < array> .argmin(< axis> )
1730
1730
```
1731
1731
1732
1732
### Indexing
You can’t perform that action at this time.
0 commit comments