NumPy arrays का indexing

MATLAB उपयोगकर्ताओं के लिए Python

Justin Kiggins

Product Manager

Ranges के साथ indexing

arr.shape
(100,)
slice = arr[10:15]

slice.shape
(5,)
MATLAB उपयोगकर्ताओं के लिए Python

Multidimensional arrays का indexing

image.shape
(1920, 1200)
window = image[100:150,1000:1100]

window.shape
(50,100)
MATLAB उपयोगकर्ताओं के लिए Python

Boolean arrays के साथ indexing

data.shape
(10000,)
is_valid.dtype
bool
np.sum(is_valid)
8732
valid_data = data[is_valid]
valid_data.shape
(8732,)
MATLAB उपयोगकर्ताओं के लिए Python

अभ्यास करते हैं!

MATLAB उपयोगकर्ताओं के लिए Python

Preparing Video For Download...