Skip to content

How to pass an n-dimentional numpy array from python -> c++ #3438

Answered by munkybutt
munkybutt asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the reply - sorry for the delayed response.
I got an answer on stack overflow which works, effectively using Eigen Matrices:
https://stackoverflow.com/questions/69831285/pybind11-how-to-pass-an-n-dimentional-numpy-array-from-python-c
The conversion is automatic and using the Eigen::Ref, there is no copying of data

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by munkybutt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants