The Setup :
I have two arrays from shared memory reals and imags :
#/usr/bin/env python2
reals = multiprocessing.RawArray('d', 10000000)
imags = multiprocessing.RawArray('d', 10000000)
then I make them numpy-arrays, named reals2 and imags2, without any copy :
import numpy as np
reals2 = np.frombuffer(reals)
imags2 = np.frombuffer(imags)
# check if the objects did a copy
assert reals2.flags['OWNDATA'] is False
assert imags2.flags['OWNDATA'] is False
I would like to then make a np.complex128 1D-array data, again without copying the data, but I don't know how to.
The Questions :
Can you make a np.complex128 1D-array data from a pair of float arrays, without copying, yes/no?
If yes, how?