Answers for "find first in np arrau"

0

find first in np arrau

>>> t = array([1, 1, 1, 2, 2, 3, 8, 3, 8, 8])
>>> nonzero(t == 8)
(array([6, 8, 9]),)
>>> nonzero(t == 8)[0][0]
6
Posted by: Guest on October-18-2020

Python Answers by Framework

Browse Popular Code Answers by Language