This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

7.1.4. nilearn.connectome.sym_to_vec

nilearn.connectome.sym_to_vec(*args, **kwargs)

DEPRECATED: Function ‘sym_to_vec’ has been renamed to ‘sym_matrix_to_vec’ and will be removed in future releases.

Return the flattened lower triangular part of an array.

If diagonal is kept, diagonal elements are divided by sqrt(2) to conserve the norm.

Acts on the last two dimensions of the array if not 2-dimensional.

New in version 0.2.


symmetric : numpy.ndarray, shape (…, n_features, n_features)

Input array.

discard_diagonal : boolean, optional

If True, the values of the diagonal are not returned. Default is False.


output : numpy.ndarray

The output flattened lower triangular part of symmetric. Shape is (…, n_features * (n_features + 1) / 2) if discard_diagonal is False and (…, (n_features - 1) * n_features / 2) otherwise.