Is there a way to convert a numpy ndarray (numpy.array) to a standard-library array (array.array) without reallocating the data?
For the record it is possible to convert an array.array to a ndarray using the buffer interface, so I hope the way round is possible:
import numpy
import array
a_std = array.array('d', [1, 2, 3])
a_np = numpy.ndarray(shape=(3, ), buffer=a_std, dtype='d')
a_np[0] = 666.
assert a_std[0] == 666.