eelbrain.Case

class eelbrain.Case(n, adjacency='none')

Case dimension

Parameters:
  • n (int) – Number of cases.

  • adjacency ('grid' | 'none' | array of int, (n_edges, 2)) – Adjacency between elements. Set to "none" for no connections or "grid" to use adjacency in the sequence of elements as connection. Set to numpy.ndarray to specify custom adjacency. The array should be of shape (n_edges, 2), and each row should specify one connection [i, j] with i < j, with rows sorted in ascending order. If the array’s dtype is uint32, property checks are disabled to improve efficiency.

Examples

When initializing an NDVar, the case dimension can be speciied with the bare class and the number of cases will be inferred from the data:

>>> NDVar([[1, 2], [3, 4]], (Case, Categorial('column', ['1', '2'])))
<NDVar: 2 case, 2 column>

Methods

adjacency()

Retrieve the dimension's adjacency graph

dimindex(arg)

Convert a dimension index to an array index

index_into_dim(dim)

Index into a subset dimension

intersect(dim[, check_dims])

Create a Dimension that is the intersection with dim