문제

Title says it all, I somehow can not find that function. Obviously it's inside the Numpy package (numpy.core.umath.deg2rad) and I've tried importing it but to no avail. Anyone care to chime in?

  • import numpy as np - np.deg2rad doesn't even show up
  • from numpy import* - umath.deg2rad shows up, but it raises an error, ''name 'umath' is not defined''
도움이 되었습니까?

해결책

from numpy.core.umath import deg2rad
# then
deg2rad(...)

Or

import numpy as np
np.core.umath.deg2rad(...)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top