Skip to content

Passing multidimensional array to Python results in a flat list #1141

Closed
@lostmsu

Description

@lostmsu

Environment

  • Pythonnet version: 2.4.0
  • Python version: any
  • Operating System: any

Details

var array = new int[5,5];
dynamic numpyArray = np.array(array);
Console.WriteLine(numpyArray.shape);

Expected:

(5, 5)

Actual:

25

Workaround

Write a custom IPyObjectEncoder for multidimensional arrays.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions