Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Trouble with n-dimensional arrays#2355

RoboEyes started this conversation inGeneral
Apr 4, 2024· 1 comments· 1 reply
Discussion options

I just started using pythonnet with C# and I am having trouble passing multi-dimensional arrays back and forth between python and C#. I can receive the arrays in C# but I can not convert the PyObject received to a C# object. Can someone point me to some documentation or example code to help me figure this issue out? To be a little more specific, on the python side I am creating and working with 2, 3 and 4 dimensional matrices that I would like to pass to C#. I can pass the data but I am unable to convert these matrices into C# objects. These matrices are float and integer matrices. Thank you.

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

If the memory is contiguous, you can usemyPyObject.GetBuffer in C# and copy the memory into a .NET object.

You must be logged in to vote
1 reply
@RoboEyes
Comment options

Thank you for your response, that worked.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@RoboEyes@tebjan

[8]ページ先頭

©2009-2025 Movatter.jp