diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-04-06 16:08:30 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-06 16:08:30 -0600 |
commit | 1f9c30ef0f4f7a0c3e0227c3de681a11fcc24861 (patch) | |
tree | 0f69a88b9e69636bb034a50f4ebdacff1357f7cf /numpy/core/fromnumeric.py | |
parent | a3c28010ca5427cf67346c928f7319c111d84fd8 (diff) | |
parent | 2ee7c72e56b5ef16f3838f86de8ad0d435b9b4e0 (diff) | |
download | numpy-1f9c30ef0f4f7a0c3e0227c3de681a11fcc24861.tar.gz |
Merge pull request #10826 from tylerjereddy/issue_10779_squeeze
BUG: np.squeeze() now respects older API axis expectation
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 63279ffb3..5f1aadbf5 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -1280,13 +1280,10 @@ def squeeze(a, axis=None): squeeze = a.squeeze except AttributeError: return _wrapit(a, 'squeeze') - try: - # First try to use the new axis= parameter - return squeeze(axis=axis) - except TypeError: - # For backwards compatibility + if axis is None: return squeeze() - + else: + return squeeze(axis=axis) def diagonal(a, offset=0, axis1=0, axis2=1): """ |