From 10df3978b0aec1f6a1c7e6491149c73edf1d6f6c Mon Sep 17 00:00:00 2001 From: Joni Herttuainen Date: Thu, 4 Jan 2024 13:37:30 +0100 Subject: [PATCH] return False in _positional mask if no ids --- bluepysnap/query.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bluepysnap/query.py b/bluepysnap/query.py index f09b1178..b8d404ce 100644 --- a/bluepysnap/query.py +++ b/bluepysnap/query.py @@ -100,6 +100,8 @@ def _positional_mask(data, ids): return True if isinstance(ids, int): ids = [ids] + elif len(ids) == 0: + return False mask = np.full(len(data), fill_value=False) indices = data.index.get_indexer(ids) mask[indices[indices > -1]] = True