pymaid.group_matrix¶
- pymaid.group_matrix(mat, row_groups={}, col_groups={}, drop_ungrouped=False, method='SUM', remote_instance=None)[source]¶
Groups adjacency matrix into neuron groups.
- Parameters:
mat (pandas.DataFrame | numpy.array) – Matrix to group.
row_groups (dict, optional) –
- Row groups to be formed. Can be either:
{group1: [neuron1, neuron2, ...], ...}
{neuron1: group1, neuron2:group2, ...}
If grouping numpy arrays, use indices!
col_groups (dict, optional) – Col groups. See
row_groups
for details.drop_ungrouped (bool, optional) – If ungrouped, neurons that are not part of a row/col_group are dropped from the matrix.
method ('AVERAGE' | 'MAX' | 'MIN' | 'SUM', optional) – Method by which values are collapsed into groups.
remote_instance (CatmaidInstance, optional) – If not passed, will try using globally defined.
- Return type:
pandas.DataFrame