[Python.NET] converting double array to numpy list
siddhupiddu at gmail.com
Wed Aug 20 19:21:45 CEST 2014
How do I pass a double array as a numpy list from C# (calling python code
from c#) or passing something that can become a numpy list with minimal
Right now, the naive way would be to create a new PyList. And to fill it
with elements from the double array.
But I read on a thread on this list (
Marshal.copy was faster.
So, I tried Marshal.copy but I can't figure out how to instantiate a numpy
array in python. Numpy can instantiate a new array from native C array by
So, theoretically if i can do
Marshal.Copy(csharparray,0,addrofnative,csharparray.Length) and pass the
addrofnative (which is a IntPtr) I could be done. But I can only pass
PyObject when calling a module function.
Any ideas ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PythonDotNet