+ '''reshape(a, newshape)
+ Gives a new shape to an array without changing its data.
+ newshape : int or tuple of ints
+ The new shape should be compatible with the original shape. If
+ an integer, then the result will be a 1-D array of that length.
+ One shape dimension can be -1. In this case, the value is inferred
+ from the length of the array and remaining dimensions.
+ reshaped_array : ndarray
+ This will be a new view object if possible; otherwise, it will
+ ndarray.reshape : Equivalent method.
+ It is not always possible to change the shape of an array without
+ copying the data. If you want an error to be raise if the data is copied,
+ you should assign the new shape to the shape attribute of the array
+ if not hasattr(a, 'reshape'):
+ return a.reshape(shape)