Skip to content

Commit

Permalink
NeuronList: add masked property to summary
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Jan 27, 2025
1 parent d048f35 commit 291a54c
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions navis/core/neuronlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,23 @@ def summary(self,
if not isinstance(N, slice):
N = slice(N)

return pd.DataFrame(data=[[getattr(n, a, 'NA') for a in props]
for n in config.tqdm(self.neurons[N],
desc='Summarizing',
leave=False,
disable=not progress)],
columns=props)
summary = pd.DataFrame(
data=[
[getattr(n, a, "NA") for a in props]
for n in config.tqdm(
self.neurons[N],
desc="Summarizing",
leave=False,
disable=not progress,
)
],
columns=props,
)

if any((n.is_masked for n in self.neurons[N])):
summary['masked'] = [n.is_masked for n in self.neurons[N]]

return summary

def itertuples(self):
"""Helper to mimic `pandas.DataFrame.itertuples()`."""
Expand Down

0 comments on commit 291a54c

Please sign in to comment.