eelbrain.NDVar.all
- NDVar.all(axis=None, **regions)
Whether all values are nonzero over given dimensions
- Parameters
axis (Union[None, str, Sequence[str], NDVar]) – Dimensions over which to operate. A str is used to specify a single dimension, a tuple of str to specify several dimensions, None to compute whether there are any nonzero values at all. An boolean NDVar with the same dimensions as the data can be used to find nonzero values in specific elements (if the NDVar has cases on a per case basis).
**regions – Regions over which to aggregate as keywords. For example, to check whether all values between time=0.1 and time=0.2 are non-zero, use
ndvar.all(time=(0.1, 0.2))
.name (str) – Name of the output NDVar (default is the current name).
- Returns
Boolean data indicating presence of nonzero value over specified dimensions. Return a Var if only the case dimension remains, and a boolean if the function collapses over all data.
- Return type
any
Examples
Examples for
>>> ndvar <NDVar 'utsnd': 60 case, 5 sensor, 100 time>
Check whether all values are nonzero:
>>> ndvar.all() True
Check whether each time point contains at least one non-zero value
>>> ndvar.all(('case', 'sensor')) <NDVar 'utsnd': 100 time>
Check for nonzero values between time=0.1 and time=0.2
>>> ndvar.all(time=(0.1, 0.2)) <NDVar 'utsnd': 60 case, 5 sensor>