Browse Source

Numpy

pull/10/head
Jure Šorn 5 years ago
parent
commit
1660c24914
1 changed files with 6 additions and 6 deletions
  1. 12
      README.md

12
README.md

@ -1733,14 +1733,14 @@ import numpy as np
### Indexing ### Indexing
#### Basic indexing: #### Basic indexing:
```bash ```bash
<el> = <2d_array>[0, 0]
<el> = <2d_array>[0, 0]
``` ```
#### Basic slicing: #### Basic slicing:
```bash ```bash
<1d_view> = <2d_array>[0] # First row.
<1d_view> = <2d_array>[:, 0] # First column. Also [..., 0].
<3d_view> = <2d_array>[None, :, :] # Expanded by dimension of size 1.
<1d_view> = <2d_array>[0] # First row.
<1d_view> = <2d_array>[:, 0] # First column. Also [..., 0].
<3d_view> = <2d_array>[None, :, :] # Expanded by dimension of size 1.
``` ```
#### Integer array indexing: #### Integer array indexing:
@ -1753,8 +1753,8 @@ import numpy as np
#### Boolean array indexing: #### Boolean array indexing:
```bash ```bash
<2d_bool_array> = <2d_array> > 0
<1d_array> = <2d_array>[<2d_bool_array>]
<2d_bools> = <2d_array> > 0
<1d_array> = <2d_array>[<2d_bools>]
``` ```
### Broadcasting ### Broadcasting

Loading…
Cancel
Save