Resize the matrix in-place to dimensions given by
Any elements that lie within the new shape will remain at the same indices, while non-zero elements lying outside the new shape are removed.
- shape : (int, int)
number of rows and columns in the new matrix
The semantics are not identical to
numpy.resize. Here, the same data will be maintained at each index before and after reshape, if that index is within the new bounds. In numpy, resizing maintains contiguity of the array, moving elements around in the logical matrix but not within a flattened representation.
We give no guarantees about whether the underlying data attributes (arrays, etc.) will be modified in place or replaced with new objects.