I would like to init a .NET jagged array from Python using the pythonnet packages. For an one dimensional array I can do it like that:
import clr
from System import Array
a = Array[int]([1, 2, 3])
But how can I do that for jagged array? So let's assume I've in python the following list of list:
[[1, 2, 3], [4, 5, 6]]
In C# I would do it like that:
int[][] a = new int[][] { new int[] { 1, 2, 3 }, new int[] { 4, 5, 6 }};
Array[Array[int]]([[1, 2, 3], [4, 5, 6]])Array[Array[int]]((Array[int]((1,2,3)), (Array[int]((4,5,6)))b = Array[Array[int]]([Array[int]([1,2,3]), Array[int]([4,5,6])])works. But how can I write a python function that converts a jagged array which has n dimensions?