Search code examples
pythonnumpytype-conversionuncertainty

Python: ufloat to float


I have calculated some ufloats using the uncertainties package, let's call them theta and gamma. Now, for my following calculations I don't need their errors (I am using them later as y-values in linear plot).

I simply could calculate them ignoring their errors, but I don't want to do work twice.

i. e. my gamma is gamma=(42, 0.5) I would like to convert them into floats without their errors (so like gamma_float=42). How could I address only their values?


Solution

  • gamma.nominal_value is the nominal value of gamma (also available as gamma.n), and gamma.std_dev (also available as gamma.s) is its standard variation.