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

Case dimension

n : int

Number of cases.

connectivity : ‘grid’ | ‘none’ | array of int, (n_edges, 2)

Connectivity 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 connectivity. 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.


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>


connectivity(self) Retrieve the dimension’s connectivity graph
dimindex(self, arg) Convert a dimension index to an array index
index_into_dim(self, dim) Index into a subset dimension
intersect(self, dim[, check_dims]) Create a Dimension that is the intersection with dim