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.
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
unsafenumpy 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
PyStringand then to the numpy array constructor.Hopefully the Rust-numpy crate will add safe APIs for passing a vector of
Stringor&strto numpy from Rust.