File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ Format
329
329
```
330
330
331
331
### General Options
332
- ``` python
332
+ ``` bash
333
333
{< el> :< 10} # '<el> '
334
334
{< el> :> 10} # ' <el>'
335
335
{< el> :^10} # ' <el> '
@@ -1740,14 +1740,14 @@ import numpy as np
1740
1740
### Broadcasting
1741
1741
** Broadcasting is a set of rules by which NumPy functions operate on arrays of different sizes and/or dimensions.**
1742
1742
``` python
1743
- left = [[0.1 ], [0.6 ], [0.8 ]] # Shape: (3, 1)
1744
- right = [ 0.1 , 0.6 , 0.8 ] # Shape: (3)
1743
+ left = [[0.1 ], [0.6 ], [0.8 ]] # Shape: (3, 1)
1744
+ right = [ 0.1 , 0.6 , 0.8 ] # Shape: (3)
1745
1745
```
1746
1746
1747
1747
#### 1. If array shapes differ, left-pad the smaller shape with ones:
1748
1748
``` python
1749
- left = [[0.1 ], [0.6 ], [0.8 ]] # Shape: (3, 1)
1750
- right = [[0.1 , 0.6 , 0.8 ]] # Shape: (1, 3) <- !
1749
+ left = [[0.1 ], [0.6 ], [0.8 ]] # Shape: (3, 1)
1750
+ right = [[0.1 , 0.6 , 0.8 ]] # Shape: (1, 3) <- !
1751
1751
```
1752
1752
1753
1753
#### 2. If any dimensions differ in size, expand the ones that have size 1 by duplicating their elements:
You can’t perform that action at this time.
0 commit comments