Method in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Method in python

The method vectorize how it work ?

15th Mar 2020, 4:22 PM
Njood Jasser
2 Answers
+ 3
Don't write your code into the question tags, look at how messy the tags look. Just tag a relevant language and/or subject -> Python numpy vectorize
15th Mar 2020, 4:34 PM
Ipang
- 1
# maximize function def h(x): if x < -1 or x > 1: y = 0 else: y = (np.cos(20*x) + np.sin(50*x)) return y hv = np.vectorize(h)
15th Mar 2020, 4:22 PM
Njood Jasser