Created
June 12, 2017 12:44
-
-
Save syrte/f056973f9b341b94fa6e5842a023e48e to your computer and use it in GitHub Desktop.
vi ~/local/anaconda2/lib/python2.7/site-packages/numpy/lib/function_base.py
This file contains hidden or 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
| # Do not modify the original value of range so we can check for `None` | |
| if range is None: | |
| if a.size == 0: | |
| # handle empty arrays. Can't determine range, so use 0-1. | |
| mn, mx = 0.0, 1.0 | |
| else: | |
| mn, mx = a.min() + 0.0, a.max() + 0.0 | |
| # add below | |
| if not np.all(np.isfinite([mn, mx])): | |
| b = a[np.isfinite(a)] | |
| if b.size == 0: | |
| mn, mx = 0., 1. | |
| else: | |
| mn, mx = b.min() + 0.0, b.max() + 0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment