ich portiere mir gerade einige Python routinen nach Pascal und stehe nun vor folgendem Problem:
Code: Alles auswählen
Type
TDoubleArray = Array Of Double;
numpy = record
fContent: Array Of TDoubleArray;
End;
Function toNumpy(data: Array Of Double): numpy;
Var
j: Integer;
Begin
setlength(result.fContent, length(data), 1);
For j := 0 To high(data) Do Begin
result.fContent[j, 0] := data[j];
End;
End;
Function toNumpy2(data: Array Of TDoubleArray): numpy;
Var
i, j: Integer;
Begin
setlength(result.fContent, length(data), length(data[0]));
For j := 0 To high(data) Do Begin
For i := 0 To high(data[0]) Do Begin
result.fContent[j, i] := data[j, i];
End;
End;
End;
Code: Alles auswählen
a := toNumpy([1.0, 2.0]);
b := toNumpy2([[2.0, 4.0, 6.0], [3.0, 5.0, 7.0]]); // -- Hier kriege ich einen Compilerfehler