Skip to content

Instantly share code, notes, and snippets.

@michelp
Created December 22, 2019 22:42
Show Gist options
  • Save michelp/bb9b0b44381c437dd259c7f67c704185 to your computer and use it in GitHub Desktop.
Save michelp/bb9b0b44381c437dd259c7f67c704185 to your computer and use it in GitHub Desktop.
In [1]: import numpy as np
In [2]: a = np.array([1,2,3])
In [3]: a
Out[3]: array([1, 2, 3])
In [4]: a > 2
Out[4]: array([False, False, True])
In [5]: a[a > 2]
Out[5]: array([3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment