Open
Description
For the "just do in 3.0" pile. Index.__array_wrap__
reads
def __array_wrap__(self, result, context=None):
"""
Gets called after a ufunc and other functions e.g. np.split.
"""
result = lib.item_from_zerodim(result)
if is_bool_dtype(result) or lib.is_scalar(result) or np.ndim(result) > 1:
return result
return Index(result, name=self.name)
The is_bool_dtype check is left over from before we supported bool-dtype Indexes. Affected tests are pandas/tests/indexes/test_numpy_compat.py::test_numpy_ufuncs_other