How to share a plain c-array as numpy array, reflecting changes in c-array data, and without copy #3461
erwincoumans
started this conversation in
General
Replies: 1 comment
-
adding an empty capsule fixed it!
now:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
See also Issue #1042 (#1042) but for plain C-array
I like to share a c-array to Python as numpy array, without copying data. If the c-array changes, the numpy array should reflect the changes. When using py::array, the data seems to be copied and not changed, when the c-array changes.
when using this test script:
The output is
I'd like to see 123 in the first field.
(here is a github link to reproduce, call python setup.py install and run python test.py)
What can be done to fix this?
Beta Was this translation helpful? Give feedback.
All reactions