@@ -2009,43 +2009,6 @@ def empty(self) -> bool_t:
2009
2009
def __array__ (self , dtype : npt .DTypeLike | None = None ) -> np .ndarray :
2010
2010
return np .asarray (self ._values , dtype = dtype )
2011
2011
2012
- def __array_wrap__ (
2013
- self ,
2014
- result : np .ndarray ,
2015
- context : tuple [Callable , tuple [Any , ...], int ] | None = None ,
2016
- ):
2017
- """
2018
- Gets called after a ufunc and other functions.
2019
-
2020
- Parameters
2021
- ----------
2022
- result: np.ndarray
2023
- The result of the ufunc or other function called on the NumPy array
2024
- returned by __array__
2025
- context: tuple of (func, tuple, int)
2026
- This parameter is returned by ufuncs as a 3-element tuple: (name of the
2027
- ufunc, arguments of the ufunc, domain of the ufunc), but is not set by
2028
- other numpy functions.q
2029
-
2030
- Notes
2031
- -----
2032
- Series implements __array_ufunc_ so this not called for ufunc on Series.
2033
- """
2034
- # Note: at time of dask 2022.01.0, this is still used by dask
2035
- warnings .warn (
2036
- "The __array_wrap__ method of DataFrame and Series will be removed in "
2037
- "a future version" ,
2038
- DeprecationWarning ,
2039
- stacklevel = find_stack_level (),
2040
- )
2041
- res = lib .item_from_zerodim (result )
2042
- if is_scalar (res ):
2043
- # e.g. we get here with np.ptp(series)
2044
- # ptp also requires the item_from_zerodim
2045
- return res
2046
- d = self ._construct_axes_dict (self ._AXIS_ORDERS , copy = False )
2047
- return self ._constructor (res , ** d ).__finalize__ (self , method = "__array_wrap__" )
2048
-
2049
2012
@final
2050
2013
def __array_ufunc__ (
2051
2014
self , ufunc : np .ufunc , method : str , * inputs : Any , ** kwargs : Any
0 commit comments