From 72f0df587b632f0e007d1f0638c47a28fef70fdd Mon Sep 17 00:00:00 2001 From: "S.J. van Rijn" Date: Tue, 16 May 2017 11:36:05 +0200 Subject: [PATCH] Added int() calls around m.floor return values to be used as indices --- pyKriging/samplingplan.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyKriging/samplingplan.py b/pyKriging/samplingplan.py index da7384e..8e82ee0 100644 --- a/pyKriging/samplingplan.py +++ b/pyKriging/samplingplan.py @@ -155,14 +155,14 @@ def perturb(self,X,PertNum): [n,k] = np.shape(X_pert) for pert_count in range(0,PertNum): - col = m.floor(np.random.rand(1)*k) + col = int(m.floor(np.random.rand(1)*k)) #Choosing two distinct random points el1 = 0 el2 = 0 while el1 == el2: - el1 = m.floor(np.random.rand(1)*n) - el2 = m.floor(np.random.rand(1)*n) + el1 = int(m.floor(np.random.rand(1)*n)) + el2 = int(m.floor(np.random.rand(1)*n)) #swap the two chosen elements arrbuffer = X_pert[el1,col]