What's the fastest way to convert an interleaved NumPy integer array to complex64? What's the fastest way to convert an interleaved NumPy integer array to complex64? numpy numpy

What's the fastest way to convert an interleaved NumPy integer array to complex64?


[~]|1> import numpy as np[~]|2> a = np.zeros(1000000, dtype=np.int16)[~]|3> b = a.astype(np.float32).view(np.complex64)[~]|4> b.shape(500000,)[~]|5> b.dtypedtype('complex64')