find index of values greater than python
>>> [i for i,v in enumerate(a) if v > 4]
[4, 5, 6, 7, 8]
#enumerate returns the index and value of each item in an array.
#So if the value v is greater than 4, include the index i in the new array.
find index of values greater than python
>>> [i for i,v in enumerate(a) if v > 4]
[4, 5, 6, 7, 8]
#enumerate returns the index and value of each item in an array.
#So if the value v is greater than 4, include the index i in the new array.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us