scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersReturns
group_columns(A, order=0)

Two columns are in the same group if in each row at least one of them has zero. A greedy sequential algorithm is used to construct groups.

Parameters

A : array_like or sparse matrix, shape (m, n)

Matrix of which to group columns.

order : int, iterable of int with shape (n,) or None

Permutation array which defines the order of columns enumeration. If int or None, a random permutation is used with :None:None:`order` used as a random seed. Default is 0, that is use a random permutation but guarantee repeatability.

Returns

groups : ndarray of int, shape (n,)

Contains values from 0 to n_groups-1, where n_groups is the number of found groups. Each value groups[i] is an index of a group to which ith column assigned. The procedure was helpful only if n_groups is significantly less than n.

Group columns of a 2-D matrix for sparse finite differencing .

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/optimize/_numdiff.py#214
type: <class 'function'>
Commit: