我有一个Python函数,例如
def add_data(input_df):
”“”
对 input_df (Polars 数据框)进行一些操作,例如用新值填充某些列
”“”
我想在 Rust 函数中使用这个函数。 input_df 可能有几十兆字节大,所以我想在 Python 和 Rust 之间使用零拷贝共享。有可用的示例代码吗?
I found 是否可以在 cython 中访问 Polars 的底层数据? https://stackoverflow.com/questions/73102526/is-it-possible-to-access-underlying-data-from-polars-in-cython/73113179#73113179但这似乎是Cython。我正在寻找一种纯粹的Python方式。
我为此做了一个板条箱,以使其变得容易:https://github.com/pola-rs/pyo3-polars https://github.com/pola-rs/pyo3-polars
请参阅示例以开始使用:https://github.com/pola-rs/pyo3-polars/tree/main/example https://github.com/pola-rs/pyo3-polars/tree/main/example
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)