22import collections .abc
33import functools
44import re
5- import sys
65import warnings
76
87import numpy as np
6867 'rot90' , 'extract' , 'place' , 'vectorize' , 'asarray_chkfinite' , 'average' ,
6968 'bincount' , 'digitize' , 'cov' , 'corrcoef' ,
7069 'median' , 'sinc' , 'hamming' , 'hanning' , 'bartlett' ,
71- 'blackman' , 'kaiser' , 'trapezoid' , 'trapz' , ' i0' ,
70+ 'blackman' , 'kaiser' , 'trapezoid' , 'i0' ,
7271 'meshgrid' , 'delete' , 'insert' , 'append' , 'interp' ,
7372 'quantile'
7473 ]
@@ -2119,62 +2118,6 @@ def place(arr, mask, vals):
21192118 return _place (arr , mask , vals )
21202119
21212120
2122- def disp (mesg , device = None , linefeed = True ):
2123- """
2124- Display a message on a device.
2125-
2126- .. deprecated:: 2.0
2127- Use your own printing function instead.
2128-
2129- Parameters
2130- ----------
2131- mesg : str
2132- Message to display.
2133- device : object
2134- Device to write message. If None, defaults to ``sys.stdout`` which is
2135- very similar to ``print``. `device` needs to have ``write()`` and
2136- ``flush()`` methods.
2137- linefeed : bool, optional
2138- Option whether to print a line feed or not. Defaults to True.
2139-
2140- Raises
2141- ------
2142- AttributeError
2143- If `device` does not have a ``write()`` or ``flush()`` method.
2144-
2145- Examples
2146- --------
2147- >>> import numpy as np
2148-
2149- Besides ``sys.stdout``, a file-like object can also be used as it has
2150- both required methods:
2151-
2152- >>> from io import StringIO
2153- >>> buf = StringIO()
2154- >>> np.disp('"Display" in a file', device=buf)
2155- >>> buf.getvalue()
2156- '"Display" in a file\\ n'
2157-
2158- """
2159-
2160- # Deprecated in NumPy 2.0, 2023-07-11
2161- warnings .warn (
2162- "`disp` is deprecated, "
2163- "use your own printing function instead. "
2164- "(deprecated in NumPy 2.0)" ,
2165- DeprecationWarning ,
2166- stacklevel = 2
2167- )
2168-
2169- if device is None :
2170- device = sys .stdout
2171- if linefeed :
2172- device .write (f'{ mesg } \n ' )
2173- else :
2174- device .write (f'{ mesg } ' )
2175- device .flush ()
2176-
2177-
21782121# See https://docs.scipy.org/doc/numpy/reference/c-api.generalized-ufuncs.html
21792122_DIMENSION_NAME = r'\w+'
21802123_CORE_DIMENSION_LIST = f'(?:{ _DIMENSION_NAME } (?:,{ _DIMENSION_NAME } )*)?'
@@ -2926,13 +2869,13 @@ def cov(m, y=None, rowvar=True, bias=False, ddof=None, fweights=None,
29262869 return c .squeeze ()
29272870
29282871
2929- def _corrcoef_dispatcher (x , y = None , rowvar = None , bias = None , ddof = None , * ,
2872+ def _corrcoef_dispatcher (x , y = None , rowvar = None , * ,
29302873 dtype = None ):
29312874 return (x , y )
29322875
29332876
29342877@array_function_dispatch (_corrcoef_dispatcher )
2935- def corrcoef (x , y = None , rowvar = True , bias = np . _NoValue , ddof = np . _NoValue , * ,
2878+ def corrcoef (x , y = None , rowvar = True , * ,
29362879 dtype = None ):
29372880 """
29382881 Return Pearson product-moment correlation coefficients.
@@ -2959,14 +2902,7 @@ def corrcoef(x, y=None, rowvar=True, bias=np._NoValue, ddof=np._NoValue, *,
29592902 variable, with observations in the columns. Otherwise, the relationship
29602903 is transposed: each column represents a variable, while the rows
29612904 contain observations.
2962- bias : _NoValue, optional
2963- Has no effect, do not use.
29642905
2965- .. deprecated:: 1.10.0
2966- ddof : _NoValue, optional
2967- Has no effect, do not use.
2968-
2969- .. deprecated:: 1.10.0
29702906 dtype : data-type, optional
29712907 Data-type of the result. By default, the return data-type will have
29722908 at least `numpy.float64` precision.
@@ -2990,11 +2926,6 @@ def corrcoef(x, y=None, rowvar=True, bias=np._NoValue, ddof=np._NoValue, *,
29902926 interval [-1, 1] in an attempt to improve on that situation but is not
29912927 much help in the complex case.
29922928
2993- This function accepts but discards arguments `bias` and `ddof`. This is
2994- for backwards compatibility with previous versions of this function. These
2995- arguments had no effect on the return values of the function and can be
2996- safely ignored in this and previous versions of numpy.
2997-
29982929 Examples
29992930 --------
30002931 >>> import numpy as np
@@ -3061,10 +2992,6 @@ def corrcoef(x, y=None, rowvar=True, bias=np._NoValue, ddof=np._NoValue, *,
30612992 1. ]])
30622993
30632994 """
3064- if bias is not np ._NoValue or ddof is not np ._NoValue :
3065- # 2015-03-15, 1.10
3066- warnings .warn ('bias and ddof have no effect and are deprecated' ,
3067- DeprecationWarning , stacklevel = 2 )
30682995 c = cov (x , y , rowvar , dtype = dtype )
30692996 try :
30702997 d = diag (c )
@@ -5080,24 +5007,6 @@ def trapezoid(y, x=None, dx=1.0, axis=-1):
50805007 return ret
50815008
50825009
5083- @set_module ('numpy' )
5084- def trapz (y , x = None , dx = 1.0 , axis = - 1 ):
5085- """
5086- `trapz` is deprecated in NumPy 2.0.
5087-
5088- Please use `trapezoid` instead, or one of the numerical integration
5089- functions in `scipy.integrate`.
5090- """
5091- # Deprecated in NumPy 2.0, 2023-08-18
5092- warnings .warn (
5093- "`trapz` is deprecated. Use `trapezoid` instead, or one of the "
5094- "numerical integration functions in `scipy.integrate`." ,
5095- DeprecationWarning ,
5096- stacklevel = 2
5097- )
5098- return trapezoid (y , x = x , dx = dx , axis = axis )
5099-
5100-
51015010def _meshgrid_dispatcher (* xi , copy = None , sparse = None , indexing = None ):
51025011 return xi
51035012
0 commit comments