eelbrain.set_adjacency

eelbrain.set_adjacency(data, dim=None, adjacency='none', name=None)

Change the adjacency of an NDVar or a Dimension

Parameters:
  • data (NDVar | Dimension) – NDVar for which to change the adjacency.

  • dim (str) – Dimension for which to set the adjacency.

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

  • name (str) – Name for the new NDVar (default is data.name).

Returns:

Shallow copy of data with the new adjacency.

Return type:

data_with_adjacency