eelbrain.Dimension

class eelbrain.Dimension(name, adjacency)[source]

Base class for NDVar dimensions.

This class is typically not instantiated, but can be used for instance checks.

Parameters:
  • name (str) – Dimension name.

  • adjacency (AdjacencyArg) – 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.

x

Numerical values (e.g. for locating categories on an axis).

Type:

numpy._typing._array_like.ArrayLike

values

Meaningful point descriptions (e.g. time points, sensor names, …).

Type:

collections.abc.Sequence

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