I have a list of values and would like to convert it to the log of that list or pass the log of a list to a function. I'm more familiar with R and you can usually throw some () around anything. When I attempt this in Python I get the error:
TypeError: must be real number, not list
List looks like this:
pressures[:5]
Out[11]: [1009.58, 1009.58, 1009.55, 1009.58, 1009.65]
It doesn't really matter where I try to take the log, I get the same error...in a function:
plt.plot(timestamps, log(pressures))
plt.xlabel('Timestamps')
plt.ylabel('Air Pressure')
plt.show()
Whilst parsing data:
pressures = log([record['air_pressure'] for record in data])