diff options
author | Garrett-R <garrettreynolds5@gmail.com> | 2014-12-16 22:50:26 -0800 |
---|---|---|
committer | Garrett-R <garrettreynolds5@gmail.com> | 2015-01-02 10:52:05 +0530 |
commit | 78f69df28acd80654705a43bcf1e977b9c423b53 (patch) | |
tree | c591ae02c93cafb3caf861b997a665c0c3011122 /numpy/core/arrayprint.py | |
parent | fb898ce678c8d45364d1ee7b1a6d0308562a8ad9 (diff) | |
download | numpy-78f69df28acd80654705a43bcf1e977b9c423b53.tar.gz |
BUG: Fixes #5376: np.ravel to return same array type
In PR #5358, np.diagonal was modified to return whatever array type it took in.
Also, np.cumsum and np.clip return the same array type. So, np.ravel's behavior is surprising.
Two tests which were expecting np.ravel to return an array have been changed.
Also, the optional `order` parameter was added to MaskedArray.ravel to make it compatible
(matrix.ravel already had this parameter).
Diffstat (limited to 'numpy/core/arrayprint.py')
-rw-r--r-- | numpy/core/arrayprint.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py index db491e6f5..125d57672 100644 --- a/numpy/core/arrayprint.py +++ b/numpy/core/arrayprint.py @@ -21,6 +21,7 @@ from . import numerictypes as _nt from .umath import maximum, minimum, absolute, not_equal, isnan, isinf from .multiarray import format_longfloat, datetime_as_string, datetime_data from .fromnumeric import ravel +from .numeric import asarray if sys.version_info[0] >= 3: _MAXINT = sys.maxsize @@ -250,7 +251,7 @@ def _array2string(a, max_line_width, precision, suppress_small, separator=' ', data = _leading_trailing(a) else: summary_insert = "" - data = ravel(a) + data = ravel(asarray(a)) formatdict = {'bool' : _boolFormatter, 'int' : IntegerFormat(data), |