diff --git a/pypillometry/baseline.py b/pypillometry/baseline.py index 1ed9e99..640935e 100644 --- a/pypillometry/baseline.py +++ b/pypillometry/baseline.py @@ -202,7 +202,7 @@ def downsample(y,R): """ pad_size = int(math.ceil(float(y.size)/R)*R - y.size) y_padded = np.append(y, np.zeros(pad_size)*np.NaN) - y2=scipy.nanmean(y_padded.reshape(-1,R), axis=1) + y2=np.nanmean(y_padded.reshape(-1,R), axis=1) return y2 diff --git a/pypillometry/convenience.py b/pypillometry/convenience.py index 6bc65bb..deacfe5 100644 --- a/pypillometry/convenience.py +++ b/pypillometry/convenience.py @@ -25,7 +25,7 @@ def p_asym_laplac(y, mu, sigma, tau): tau in [0,1] """ - I=np.array(y<=mu, dtype=np.int) + I=np.array(y<=mu, dtype=int) return (2*tau*(1-tau))/sigma*np.exp(-2/sigma * ( (1-tau)*I*(mu-y) + tau*(1-I)*(y-mu) ) ) def p_asym_laplac_kappa(y, mu, lam, kappa): @@ -35,7 +35,7 @@ def p_asym_laplac_kappa(y, mu, lam, kappa): kappa in [0, infty] where 1 means symmetry """ - I=np.array(y<=mu, dtype=np.int) + I=np.array(y<=mu, dtype=int) return (lam)/(kappa+1./kappa)*np.exp( ( (lam/kappa)*I*(y-mu) - lam*kappa*(1-I)*(y-mu) ) )