[Numpy-discussion] log of negative real numbers -> RuntimeWarning: invalid value encountered in log

Tiziano Zito opossumnano at gmail.com
Mon May 25 11:08:14 EDT 2020


>Would a "complex default" mode ever make it into numpy, to behave more like Matlab and other packages with respect to complex number handling? Sure it would make it marginally slower if enabled, but it might open the door to better compatibility when porting code to Python.

numpy already has the "complex default" log function: numpy.lib.scimath.log . There are other useful gems in that module, for example a "complex default" sqrt function

Ciao,
Tiziano


More information about the NumPy-Discussion mailing list