python - How in a numpy array we can select just rows that are multiples of for example 3? -
i search numpy statement doing this:
if a = [11,12,13,14,15,16,17,18,19,20,21] , b=3 then:
c = [rows multiples of b]=[11,14,17,20]
the following should work:
a[::b] result:
array([11, 14, 17, 20])
Comments
Post a Comment