-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Open
Description
Inspired by my discussion with @charris in #9810, I would like to propose adding an optional copy
argument to np.reshape()
and ndarray.reshape()
.
Proposed semantics:
copy=None
: copy only if necessary (default).copy=True
: always copy.copy=False
: never copy. Raise an error if the data cannot be reshaped without a copy.
This would allow users to ensure desired behavior for reshape
and alleviate the primary use case for modifying ndarray.shape
.