Created
April 5, 2019 16:01
-
-
Save tim37021/b560af267606853417b366212e526f3d to your computer and use it in GitHub Desktop.
Numpy subscribe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# arr = [1, 2, 3, 4, 5] | |
arr = np.arange(5) | |
# [1, 2, 3] | |
arr[[0, 1, 2]] | |
# [1, 3, 5] | |
arr[[True, False, True, False, True]] | |
# [4, 5] | |
arr[arr>3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment