I am trying to propagate uncertainty in Python by adding two columns together of a Pandas data frame and then taking the square root. However, when I try to use Python's math.sqrt
function, I receive a TypeError: cannot convert the series to <class 'float'>
.
Here is what I've been doing:
joinedDF['combined_error'] = math.sqrt((joinedDF.error1**2 + joinedDF.error2**2).astype(float))
Using joinedDF.dtypes
, I've verified that both error columns are float64
.
I've even tried seperating everything out, but I still receive a TypeError. Any suggestions about how to mend this?