Skip to content

Commit

Permalink
removes warning in numpy 1.13 from genutil.minmax
Browse files Browse the repository at this point in the history
fix #14
  • Loading branch information
doutriaux1 committed Sep 11, 2017
1 parent 108ad10 commit bd66684
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Lib/minmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ def minmax(*data) :
global myfunction
def myfunction(d,mx,mn):
from numpy.ma import maximum,minimum,absolute,greater,count
if isinstance(d, (int, float)):
return maximum(d, mx), minimum(d, mn)
try:
if count(d)==0 : return mx,mn
mx=float(maximum(mx,float(maximum(d))))
mn=float(minimum(mn,float(minimum(d))))
mx=float(maximum(mx,float(maximum(d,axis=None)),axis=None))
mn=float(minimum(mn,float(minimum(d,axis=None)),axis=None))
except:
for i in d:
mx,mn=myfunction(i,mx,mn)
Expand Down

0 comments on commit bd66684

Please sign in to comment.