MCPcopy Create free account
hub / github.com/numpy/numpy / _make_complex

Function _make_complex

numpy/lib/tests/test_function_base.py:37–45  ·  view source on GitHub ↗

Like real + 1j * imag, but behaves as expected when imag contains non-finite values

(real, imag)

Source from the content-addressed store, hash-verified

35
36
37def _make_complex(real, imag):
38 """
39 Like real + 1j * imag, but behaves as expected when imag contains non-finite
40 values
41 """
42 ret = np.zeros(np.broadcast(real, imag).shape, np.complex_)
43 ret.real = real
44 ret.imag = imag
45 return ret
46
47
48class TestRot90:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected