In Python 3.11.6 you can pass a numpy array to a user-defined function. The function as applied across the array and the returned object is a numpy array:
>>> import numpy as np
>>> def f(x):
... return 3*x**2 - 4*x + 5
...
>>> f(3.0)
20.0
>>> xs = np.arange(-5,5,0.25)
>>> ys = f(xs)
>>> ys
array([100. , 91.6875, 83.75 , 76.1875, 69. , 62.1875,
55.75 , 49.6875, 44. , 38.6875, 33.75 , 29.1875,
25. , 21.1875, 17.75 , 14.6875, 12. , 9.6875,
7.75 , 6.1875, 5. , 4.1875, 3.75 , 3.6875,
4. , 4.6875, 5.75 , 7.1875, 9. , 11.1875,
13.75 , 16.6875, 20. , 23.6875, 27.75 , 32.1875,
37. , 42.1875, 47.75 , 53.6875])
>>> type(ys)
<class 'numpy.ndarray'>
# lifted from
# https://github.com/karpathy/nn-zero-to-hero/blob/master/lectures/micrograd/micrograd_lecture_first_half_roughly.ipynb