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

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -