If you want Rust code to interact directly with Python data structures, bindings for the Python interpreter are required. PyO3 is one such project for which an add-on crate numpy is available which supports direct access of NumPy arrays as ArrayViews.
Assume that I have something in python ndarray:
The value is something the following:
I wonder is there any way to convert it into rust ndarray?
I'm thinking about covnert from python numpy ndarray to bytes(
values.tobytes()
) firstly, but I'm failed to convert from such bytes to ndarray.