I made a pull request to change np.ravel so that it would return the same array type (ndarray, matrix, masked array, etc.) as it took in.
This would bring np.ravel in line with other functions. For example, np.sort, np.clip, np.cumsum, np.conjugate, np.partition, np.reshape, np.transpose, etc. all return the same array type as they take in. In addition, np.diag and np.diagonal were recently changed in PR #5358 to return the same array type they take in. Now, np.ravel may be the only outstanding function with the surprising behavior of always returning an array. The concern is that *this could break the code of np.matrix users*, so @jaimefrio suggested I post here to get some feedback. You can see more comments on the PR: https://github.com/numpy/numpy/pull/5398
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
