Skip to content

How to extract arrays from a Python object? #242

@zmitchell

Description

@zmitchell

If I have a Python dictionary (i.e. a PyDict), and I call get_item on it I get back a &PyAny. How do I go about converting this to a PyArray?

All of the documentation contains examples where NumPy arrays are passed directly to the Rust extension, but I haven't seen any where they are attributes of a class or stored as a reference, in other words when there is a layer of indirection between the NumPy array and the Rust extension. I would be glad to submit an example once I know how to do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions