I’m using pythonnet (http://pythonnet.sf.net) to bind together a python framework and a .NET library (I know if IronPython but this is not the question).
Using pythonnet, I can create an Array of floats, and initialize it from a sequence of values:
>>> from System import *
>>> Array[float]([1., 2.])
<System.Double[] object at 0x8a6c46c>
I need to pass an 3×3 array of floats to a method in the the .NET library, and I can’t figure out how to create this.
Use Array.CreateInstance:
reference: http://msdn.microsoft.com/en-us/library/system.array.createinstance%28v=VS.90%29.aspx