Open
Description
Calling np.median on a complex array return a complex number with correct real part, but incorrect imaginary part. Calling np.median on the real and imaginary part of the complex array separately return the correct values.
Reproducing code example:
d = (1 + 1j) + np.random.randn(10000) + 1j * np.random.randn(10000)
print 'median(d) : %.3f + %.3f i' % (np.median(d).real, np.median(d).imag)
print 'median(d.real): %.3f' % np.median(d.real)
print 'median(d.imag): %.3f' % np.median(d.imag)
median(d) : 1.002 + 0.124 i
median(d.real): 1.002
median(d.imag): 0.998
Numpy version: 1.15.4