Load a numpy array into C from a file that was saved with numpy.save(…)

I'd like to access data in a C program that resides in a file that was written from python using numpy.save(...). So far, I was looking for a way to call the C version of numpy.load my C program, but it seems there is no directly accessible C version, because numpy.load uses the pickle module. Another solution would be to start an embedded python interpreter from C and call numpy.load in that interpreter, which should return the numpy array, which I can then access in the usual manner. However the last appraoch seems a bit to heavy, because I have to use the interpreter. Is there a better way to directly load the numpy array into C?

5
задан Christian 15 March 2011 в 15:59
поделиться