Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- arr = array([1,2,3,4,5,6,7,8,9,10])
- arr[arr>5]
- array([6,7,8,9,10])
- >>> import numpy as np
- >>> a = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
- >>> a
- array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
- >>> mask = a > 5
- >>> mask
- array([False, False, False, False, False, True, True, True, True,
- True])
- >>> a[0]
- 1
- >>> a[mask]
- array([ 6, 7, 8, 9, 10])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement