首页 > 解决方案 > 'e' python 自然对数的底

问题描述

名称'e'未定义我的python代码中出现此错误。我已经导入了 math 和 numpy 模块。我还需要什么?

标签: pythonnumpynatural-logarithm

解决方案


尝试:

from math import e

您现在可以在代码中使用“e”

或者

import math
math.e

math.e 将在您的代码中用作浮点数


推荐阅读