np.where

Published onesixx on

myArr = np.array([ [1,2,3,4,1],
                   [5,6,7,8,0],
                   [9,10,11,12,1]
myArr[ np.whare(myArr[:,4]>0) ]

# array([[ 1, 2, 3, 4, 1],
#        [ 9,10,11,12, 1 ]])
Categories: Python Basic

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x