From 8531c4bff0946d6b552cfe755f843bb07849f19f Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Mon, 12 May 2014 16:23:01 +0100 Subject: [PATCH] [params] indexing with boolean arrays switched off, rases proper error now --- GPy/core/parameterization/param.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GPy/core/parameterization/param.py b/GPy/core/parameterization/param.py index 3ccbd169..7dae04b8 100644 --- a/GPy/core/parameterization/param.py +++ b/GPy/core/parameterization/param.py @@ -137,6 +137,8 @@ class Param(OptimizationHandlable, ObsAr): slice_index = self._current_slice_ def f(a): a, b = a + if isinstance(a, numpy.ndarray) and a.dtype == bool: + raise ValueError, "Boolean indexing not implemented, use Param[np.where(index)] to index by boolean arrays!" if a not in (slice(None), Ellipsis): if isinstance(a, slice): start, stop, step = a.indices(b)