axon_population.get_mask
- axon_population.get_mask(expr: str | None = None, mask_labels: None | Iterable[str] | str = [], placed_only: bool = True, otype: None | Literal['numpy', 'list'] = None) <MagicMock name='mock.DataFrame.__or__().__or__()' id='4554618160'>
Get a population mask from an expression or a list of labels.
Note
For supopulation from expression look at
pandas.DataFrame.eval()orpandas.DataFrame.query()documentation.Tip
To simplify,
self.get_mask()correspond topandas.DataFrame.eval()andself.get_sub_population()correspond topandas.DataFrame.query()- Parameters:
expr (str | None, optional) – If not None mask is generated using
pandas.DataFrame.eval()of this expression, by default Nonemask_labels (None | Iterable[str] | str, optional) – Label or list of labels already added to the population, by default []
placed_only (bool, optional) – if True add “is_place” column to the mask, by default True
otype (None | Literal["numpy", "list"], optional) – type of the output see
df_to(), by default None
- Returns:
array like of booleen of the same size than the population corresponding to the mask
- Return type:
DataFrame | np.ndarray | list