Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> import numpy as np
- >>> arr = np.random.randint(0, 2, size=(2, 2, 2))
- >>> arr
- array([[[0, 0],
- [1, 0]],
- [[1, 1],
- [1, 0]]])
- >>> arr == 1
- array([[[False, False],
- [ True, False]],
- [[ True, True],
- [ True, False]]], dtype=bool)
- >>> arr == (1, )
- array([[[False, False],
- [ True, False]],
- [[ True, True],
- [ True, False]]], dtype=bool)
- >>> arr == (1, 1)
- array([[[False, False],
- [ True, False]],
- [[ True, True],
- [ True, False]]], dtype=bool)
- >>> arr == (1, 1, 1)
- /Users/mperry/env/mapbox35/bin/ipython:1: DeprecationWarning: elementwise == comparison failed; this will raise an error in the future.
- #!/Users/mperry/env/mapbox35/bin/python3.5
- False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement