8000 DOC: backport doc changes to numpy.vectorize [skip ci] · numpy/numpy@bc81bcf · GitHub
[go: up one dir, main page]

Skip to content

Commit bc81bcf

Browse files
committed
DOC: backport doc changes to numpy.vectorize [skip ci]
1 parent ba369e3 commit bc81bcf

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

numpy/lib/function_base.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,18 +2268,19 @@ class vectorize:
22682268
[0., 0., 0., 1., 2., 1.]])
22692269
22702270
Decorator syntax is supported. The decorator can be called as
2271-
a function to provide keyword arguments.
2272-
>>>@np.vectorize
2273-
...def identity(x):
2274-
... return x
2271+
a function to provide keyword arguments:
2272+
2273+
>>> @np.vectorize
2274+
... def identity(x):
2275+
... return x
22752276
...
2276-
>>>identity([0, 1, 2])
2277+
>>> identity([0, 1, 2])
22772278
array([0, 1, 2])
2278-
>>>@np.vectorize(otypes=[float])
2279-
...def as_float(x):
2280-
... return x
2279+
>>> @np.vectorize(otypes=[float])
2280+
... def as_float(x):
2281+
... return x
22812282
...
2282-
>>>as_float([0, 1, 2])
2283+
>>> as_float([0, 1, 2])
22832284
array([0., 1., 2.])
22842285
"""
22852286
def __init__(self, pyfunc=np._NoValue, otypes=None, doc=None,

0 commit comments

Comments
 (0)
0