python的對數
首先要導入 math 模塊:
import math
import numpy as np
math.log(8,2),此為以2為底8的對數
等於 math.log2(8);
等於np.log2(8)
自然對數: 以e為底的對數。
e = math.e 約等於 2.718281828459045;
x的自然對數為:
math.log(x,math.e);
等於np.log(x)。
python的對數
首先要導入 math 模塊:
import math
import numpy as np
math.log(8,2),此為以2為底8的對數
等於 math.log2(8);
等於np.log2(8)
自然對數: 以e為底的對數。
e = math.e 約等於 2.718281828459045;
x的自然對數為:
math.log(x,math.e);
等於np.log(x)。
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。