Skip to content

Commit

Permalink
NeuronList: fix issue with adding IDs to combined dataframes
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Aug 24, 2020
1 parent c4ad785 commit 2e3d55f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions navis/core/neuronlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2e3d55f

Please sign in to comment.