How should I compute log to the base two in python. Eg. I have this equation where I am using log base 2
import math e = -(t/T)* math.log((t/T)[, 2])
If you are on python 3.3 or above then it already has a built-in function for computing log2(x)
import math 'finds log base2 of x' answer = math.log2(x)
If you are on older version of python then you can do like this
import math 'finds log base2 of x' answer = math.log(x)/math.log(2)