잠토의 잠망경

[numpy] np.power() 본문

공부/Python

[numpy] np.power()

잠수함토끼 2019. 2. 18. 20:35

np.power()

import numpy as np

x1 = range(6)

print(np.power(x1,3))
#[0,1,8,27,64,125]

x2 = [1.0, 2.0, 3.0, 3.0, 2.0,1.0]

print(np.power(x1,x2))
#[0., 1., 8., 27., 16., 5]

제곱, a^b

Comments