September 2018
Intermediate to advanced
472 pages
12h 2m
English
Indexing allows us to take a view of a ndarray by pointing out either what slice of columns and rows to visualize, or an index:
In: import numpy as np M = np.arange(10*10, dtype=int).reshape(10,10)
[start_index_included:end_index_exclude:steps]
In: M[2:9:2,:] Out: array([[20, 21, 22, 23, 24, 25, 26, 27, 28, 29], [40, 41, 42, 43, 44, 45, 46, 47, 48, 49], [60, 61, 62, 63, 64, 65, 66, 67, 68, 69], [80, 81, 82, 83, 84, 85, 86, 87, 88, ...
Read now
Unlock full access