scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersReturns
reshape(self, shape, order='C', copy=False)

Parameters

shape : length-2 tuple of ints

The new shape should be compatible with the original shape.

order : {'C', 'F'}, optional

Read the elements using this index order. 'C' means to read and write the elements using C-like index order; e.g., read entire first row, then second row, etc. 'F' means to read and write the elements using Fortran-like index order; e.g., read entire first column, then second column, etc.

copy : bool, optional

Indicates whether or not attributes of self should be copied whenever possible. The degree to which attributes are copied varies depending on the type of sparse matrix being used.

Returns

reshaped_matrix : sparse matrix

A sparse matrix with the given :None:None:`shape`, not necessarily of the same format as the current object.

Gives a new shape to a sparse matrix without changing its data.

See Also

numpy.matrix.reshape

NumPy's implementation of 'reshape' for matrices

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/sparse/_coo.py#198
type: <class 'function'>
Commit: