@@ -2218,7 +2218,7 @@ class vectorize:
2218
2218
``pyfunc.__doc__``.
2219
2219
excluded : set, optional
2220
2220
Set of strings or integers representing the positional or keyword
2221
- arguments for which the function will not be vectorized. These will be
2221
+ arguments for which the function will not be vectorized. These will be
2222
2222
passed directly to `pyfunc` unmodified.
2223
2223
2224
2224
cache : bool, optional
@@ -2305,15 +2305,15 @@ class vectorize:
2305
2305
... while _p:
2306
2306
... res = res*x + _p.pop(0)
2307
2307
... return res
2308
- >>> vpolyval = np.vectorize(mypolyval, excluded=['p'])
2309
- >>> vpolyval(p=[1, 2, 3], x=[0, 1])
2310
- array([3, 6])
2311
2308
2312
- Positional arguments may also be excluded by specifying their position:
2309
+ Here, we exclude the zeroth argument from vectorization whether it is
2310
+ passed by position or keyword.
2313
2311
2314
- >>> vpolyval.excluded.add(0 )
2312
+ >>> vpolyval = np.vectorize(mypolyval, excluded={0, 'p'} )
2315
2313
>>> vpolyval([1, 2, 3], x=[0, 1])
2316
2314
array([3, 6])
2315
+ >>> vpolyval(p=[1, 2, 3], x=[0, 1])
2316
+ array([3, 6])
2317
2317
2318
2318
The `signature` argument allows for vectorizing functions that act on
2319
2319
non-scalar arrays of fixed length. For example, you can use it for a
0 commit comments