From 2e3d55ff5913c3fa8f8989945ec262a9977008af Mon Sep 17 00:00:00 2001 From: Philipp Schlegel Date: Mon, 24 Aug 2020 09:55:43 +0100 Subject: [PATCH] NeuronList: fix issue with adding IDs to combined dataframes --- navis/core/neuronlist.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/navis/core/neuronlist.py b/navis/core/neuronlist.py index 4840c124..ec1b2f05 100644 --- a/navis/core/neuronlist.py +++ b/navis/core/neuronlist.py @@ -277,12 +277,14 @@ def __getattr__(self, key): ignore_index=True, join='outer', sort=True) + + # For each row label which neuron (id) it belongs to df['neuron'] = None ix = 0 for k, v in enumerate(values): if isinstance(v, pd.DataFrame): - df.iloc[ix:ix:v.shape[0], - df.columns.get_loc('neuron')] = k + df.iloc[ix:v.shape[0], + df.columns.get_loc('neuron')] = self.neurons[k].id ix += v.shape[0] return df elif all(is_quantity):