Skip to content

Commit 77e1a0e

Browse files
committed
NumPy
1 parent a2a2428 commit 77e1a0e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,8 +1457,8 @@ NumPy
14571457
**Array manipulation mini language. Can run up to 100 times faster than equivalent Python code.**
14581458
```python
14591459
<array> = np.array(<list>)
1460-
<array> = np.ones(<shape>)
14611460
<array> = np.arange(from_inclusive, to_exclusive, step)
1461+
<array> = np.ones(<shape>)
14621462
<array> = np.random.randint(from_inclusive, to_exclusive, <shape>)
14631463
```
14641464

@@ -1482,17 +1482,17 @@ right = [ 0.1 , 0.6 , 0.8 ] # Shape: (3)
14821482
1. If array shapes differ, left-pad the smaller shape with ones.
14831483
```python
14841484
left = [[0.1], [0.6], [0.8]] # Shape: (3, 1)
1485-
right = [[0.1 , 0.6 , 0.8]]) # Shape: (1, 3) <- !
1485+
right = [[0.1 , 0.6 , 0.8]] # Shape: (1, 3) <- !
14861486
```
1487-
2. If any dimensions differ in size, expand the ones that have size 1, by duplicating their elements.
1487+
2. If any dimensions differ in size, expand the ones that have size 1 by duplicating their elements.
14881488
```python
14891489
left = [[0.1, 0.1, 0.1], [0.6, 0.6, 0.6], [0.8, 0.8, 0.8]] # Shape: (3, 3) <- !
14901490
right = [[0.1, 0.6, 0.8], [0.1, 0.6, 0.8], [0.1, 0.6, 0.8]] # Shape: (3, 3) <- !
14911491
```
14921492
3. If neither non-matching dimension has size 1, rise an error.
14931493

14941494
### Example
1495-
**For each point returns index of its nearest point: `[0.1, 0.6, 0.8] => [1, 2, 1])`.**
1495+
**For each point returns index of its nearest point: `[0.1, 0.6, 0.8] => [1, 2, 1]`.**
14961496
```python
14971497
>>> points = np.array([0.1, 0.6, 0.8])
14981498
array([ 0.1, 0.6, 0.8])

0 commit comments

Comments
 (0)