Answers for "python index where true"

1

python index where true

>>> import numpy as np
>>> states = [False, False, False, False, True, True, False, True, False, False, False, False, False, False, False, False]
>>> np.where(states)[0]
array([4, 5, 7])
Posted by: Guest on June-30-2020

Code answers related to "python index where true"

Python Answers by Framework

Browse Popular Code Answers by Language