Universal Array Functions

import numpy as np
arr = np.arange(11)
arr
array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10])

squer root

np.sqrt(arr)
array([0.        , 1.        , 1.41421356, 1.73205081, 2.        ,
       2.23606798, 2.44948974, 2.64575131, 2.82842712, 3.        ,
       3.16227766])

expt

np.exp(arr)
array([1.00000000e+00, 2.71828183e+00, 7.38905610e+00, 2.00855369e+01,
       5.45981500e+01, 1.48413159e+02, 4.03428793e+02, 1.09663316e+03,
       2.98095799e+03, 8.10308393e+03, 2.20264658e+04])

Binary Function

a = np.random.random(10)
a
array([0.66448087, 0.91824602, 0.12914791, 0.89981498, 0.0213797 ,
       0.80503991, 0.0320084 , 0.88814445, 0.39434936, 0.17264406])
b = np.random.random(10)
b
array([0.70085325, 0.18058017, 0.77276498, 0.13658746, 0.27129573,
       0.02266739, 0.48373145, 0.91830994, 0.95288307, 0.40011951])
np.add(a, b)
array([1.36533412, 1.0988262 , 0.90191289, 1.03640244, 0.29267542,
       0.8277073 , 0.51573985, 1.80645439, 1.34723243, 0.57276356])
np.maximum(a, b)
array([0.70085325, 0.91824602, 0.77276498, 0.89981498, 0.27129573,
       0.80503991, 0.48373145, 0.91830994, 0.95288307, 0.40011951])
np.minimum(a, b)
array([0.66448087, 0.18058017, 0.12914791, 0.13658746, 0.0213797 ,
       0.02266739, 0.0320084 , 0.88814445, 0.39434936, 0.17264406])