From 6a6f13ebc9a3db0a3aafec50f25c03943709ff84 Mon Sep 17 00:00:00 2001 From: Philipp A Date: Fri, 25 May 2018 16:39:54 +0200 Subject: [PATCH] Allow Range indices --- anndata/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/anndata/base.py b/anndata/base.py index 7d2206117..e44e469fa 100644 --- a/anndata/base.py +++ b/anndata/base.py @@ -215,7 +215,10 @@ def _fix_shapes(X): def _normalize_index(index, names): - assert names.dtype != float and names.dtype != int, 'Don’t call _normalize_index with non-categorical/string names' + if not isinstance(names, RangeIndex): + assert names.dtype != float and names.dtype != int, \ + 'Don’t call _normalize_index with non-categorical/string names' + # the following is insanely slow for sequences, we replaced it using pandas below def name_idx(i): if isinstance(i, str):