File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1693,6 +1693,7 @@ NumPy
1693
1693
import numpy as np
1694
1694
```
1695
1695
1696
+ ** Shape is a tuple of ints, representing sizes of array's dimensions.**
1696
1697
``` python
1697
1698
< array> = np.array(< list > )
1698
1699
< array> = np.arange(from_inclusive, to_exclusive, step_size)
@@ -1713,26 +1714,26 @@ import numpy as np
1713
1714
1714
1715
### Indexing
1715
1716
#### Basic indexing
1716
- ``` python
1717
+ ``` bash
1717
1718
< el> = < 2d_array> [0, 0]
1718
1719
```
1719
1720
1720
1721
#### Basic slicing
1721
- ``` python
1722
+ ``` bash
1722
1723
< 1d_view> = < 2d_array> [0] # First row.
1723
1724
< 1d_view> = < 2d_array> [:, 0] # First column. Also [..., 0].
1724
1725
< 3d_view> = < 2d_array> [None,:,:] # Expanded by dimension of size 1.
1725
1726
```
1726
1727
1727
1728
#### Integer array indexing
1728
1729
** If row and column indexes differ in shape, they are combined with broadcasting.**
1729
- ``` python
1730
+ ``` bash
1730
1731
< 1d_array> = < 2d_array> [< 1d_row_indexes> , < 1d_column_indexes> ]
1731
1732
< 2d_array> = < 2d_array> [< 2d_row_indexes> , < 2d_column_indexes> ]
1732
1733
```
1733
1734
1734
1735
#### Boolean array indexing
1735
- ``` python
1736
+ ``` bash
1736
1737
< 2d_bool_array> = < 2d_array> > 0
1737
1738
< 1d_array> = < 2d_array> [< 2d_bool_array> ]
1738
1739
```
You can’t perform that action at this time.
0 commit comments