Skip to content

Commit 5ab7bfb

Browse files
committed
Numpy
1 parent 59a2e9d commit 5ab7bfb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,9 +1325,7 @@ ValueError: malformed node or string
13251325
import ast
13261326
from ast import Num, BinOp, UnaryOp
13271327
import operator as op
1328-
```
13291328

1330-
```python
13311329
legal_operators = {ast.Add: op.add,
13321330
ast.Sub: op.sub,
13331331
ast.Mult: op.mul,
@@ -1718,15 +1716,17 @@ import numpy as np
17181716
<array> = np.random.randint(from_inclusive, to_exclusive, <shape>)
17191717
```
17201718

1719+
#### Shape is a tuple of dimension sizes:
17211720
```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>)
17251724
```
17261725

1726+
#### Axis is an index of dimension that gets collapsed:
17271727
```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>)
17301730
```
17311731

17321732
### Indexing

0 commit comments

Comments
 (0)