numpy - Python - overflow encountered in exp -
i using formula in model i'm developing, which, when runs produces runttimewarning: overflow encountered in exp. understanding i've read due excessively large numbers being used in calculation data type.
my formula stores numpy array, there method changing datatype these values can computed?
thanks
this sounds xy problem.
while higher precision datatypes possibly solve issue, comes @ performance , usability cost. not possible numpy directly, can done mpmath. more details can found in question.
before resorting such measures:
verify these large numbers correct behavior , not result bug further up.
see if possible log-transform formulas large numbers avoided.
Comments
Post a Comment