Jan-06-2021, 03:35 PM
A trick, if you work with two different same shaped arrays:
64-Bit Float for real part and 64-bit float for imaginary part.
import numpy as np shape = (64,) # one dimension # 64 elements real_part = np.random.random(shape) # is a np.ndarray of dtype np.float64 imag_part = np.random.random(shape) # is a np.ndarray of dtype np.float64 complex_array = real_part + 1j * imag_partAfter this calculation dtype of complex_array is:
np.complex128
64-Bit Float for real part and 64-bit float for imaginary part.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!