Skip to content

Improve performance of exporting variable-width strings to numpy StringDType #147

Description

@kylebarron

The only way to create a string-typed numpy array from Python is from a list of Python string objects. This is very slow because you first need to copy your data into Python string objects.

(There are some low-level unsafe numpy C APIs, but I don't want to be mucking around manually in the numpy C API.)

We currently export variable-width string data first to a list of PyString and then to the numpy array constructor.

Hopefully the Rust-numpy crate will add safe APIs for passing a vector of String or &str to numpy from Rust.

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