Skip to content

Commit 2c432c7

Browse files
committed
Numpy
1 parent f30aadd commit 2c432c7

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,32 +1731,27 @@ indexes = <array>.argmin(<axis>)
17311731
* **Axis is an index of dimension, that gets collapsed.**
17321732

17331733
### Indexing
1734-
#### Basic indexing:
1735-
```bash
1736-
<el> = <2d_array>[0, 0]
1737-
```
1738-
1739-
#### Basic slicing:
1734+
#### Basic:
17401735
```bash
1736+
<el> = <2d_array>[0, 0] # First element.
17411737
<1d_view> = <2d_array>[0] # First row.
17421738
<1d_view> = <2d_array>[:, 0] # First column. Also [..., 0].
17431739
<3d_view> = <2d_array>[None, :, :] # Expanded by dimension of size 1.
17441740
```
17451741

1746-
#### Integer array indexing:
1742+
#### Advanced:
17471743
```bash
17481744
<1d_array> = <2d_array>[<1d_row_indexes>, <1d_column_indexes>]
17491745
<2d_array> = <2d_array>[<2d_row_indexes>, <2d_column_indexes>]
17501746
```
17511747

1752-
* **If row and column indexes differ in shape, they are combined with broadcasting.**
1753-
1754-
#### Boolean array indexing:
17551748
```bash
17561749
<2d_bools> = <2d_array> > 0
17571750
<1d_array> = <2d_array>[<2d_bools>]
17581751
```
17591752

1753+
* **If row and column indexes differ in shape, they are combined with broadcasting.**
1754+
17601755
### Broadcasting
17611756
**Broadcasting is a set of rules by which NumPy functions operate on arrays of different sizes and/or dimensions.**
17621757

0 commit comments

Comments
 (0)