机器学习入门:库的导入和添加

库的导入

  • 以math库为例
import math
math.sin(pi)
math.exp(2)
  • 为库起一个别名,简化代码
import math as m
m.sin(x)
  • 导入特定的库
    上文中导入的库是导入全部的math库
from math import exp as e
e(1)#只能计算e

猜你喜欢

转载自blog.csdn.net/qq_40605167/article/details/80951636