cost 115 ms
如何使用 Vec 创建极坐标 DataFrame <vec<f64> > 作为一个系列</vec<f64> - How to create polars DataFrame with Vec<Vec<f64>> as a Series

我想要这样的 DataFrame: bids Series 有一个 Vec&lt;Vec&gt; 结构,简单来说就是一个向量,包含一对(另一个向量)价格和数量(两个值)。 创建这个所需的 rust 代码是什么? 如果可能,请在 rust 中回答,但 python 也可以,我想我可以重新创建它。 ...

Rust-polars:如何通过引用传递 function“is_in”的“其他”参数? - Rust-polars: how can I pass the "other" parameter for the function "is_in" by reference?

我是 Rust 的新手,所以如果这是一个微不足道的问题,请原谅。 我正在尝试按如下方式过滤 dataframe: 它看起来不错,因为is_in方法的签名如下所示: 来自 [https://docs.rs/polars/latest/polars/series/trait.SeriesTrait.h ...

如何使用 Rust 从一个目录中读取多个 CSV/Parquet/JSON 等文件? - How do I read multiple CSV/Parquet/JSON etc files from a directory using Rust?

我将polars与 Rust 一起使用,我希望能够读取多个 csv 文件作为输入。 我在说明如何使用 glob 模式使用 Python 读取多个文件的文档中找到此部分,但我无法在 Rust 中找到执行此操作的方法。 尝试使用 Rust 的 glob 模式不起作用。 我试过的代码是 这失败了错误 我 ...

如何通过验证列的值是否包含在向量中来过滤极坐标 DataFrame? - How do I filter a polars DataFrame by verifying if the value of a column is contained by an vector?

我有一个 dataframe,它的“ID”列的数据类型为 UInt32,我有一个名为 ids 的向量。 我想返回一个 dataframe,其中“ID”值包含在向量 ID 中的行。 最小通缉例use polars::df; use polars::prelude::*; fn filter_by_ ...

如何将 Polars `Expr`/`PyExpr`/`LogicalPlan` 从 Python 发送到 Rust? - How to send a Polars `Expr`/`PyExpr`/`LogicalPlan` from Python to Rust?

在单个进程中,我可以编写一个 Polars Expr ,然后通过with_column或select在DataFrame上使用它。 但是在实时财务数据的另一个场景中,我有一个 rust 进程作为服务器,它有很多历史和实时数据( DataFrame )。 有多个 python 进程(客户端)需要将自 ...

rust 错误:捕获的变量无法转义 `FnMut` 闭包体 - rust error: captured variable cannot escape `FnMut` closure body

以下代码尝试在通过连接获取msg后异步更新主 dataframe df (来自 polars 包)。 我已经看到关于堆栈溢出的“重复”帖子,但仍然不明白我做错了什么。 我只是想可变地借用dataframe并更新它,仅此而已,我用字符串试了一下。 它工作得很好......pub async fn ne ...

更新 Polars DataFrame 单个元素的有效方法? - Efficient way to update a single element of a Polars DataFrame?

Polars DataFrame 目前没有提供更新单个单元格值的方法。 相反,我们必须使用方法DataFrame.apply或DataFrame.apply_at_idx来更新整个列/系列。 在算法重复更新某些列的几个元素的情况下,这可能非常昂贵。 为什么DataFrame要这样设计? 查看代码 ...

Selecting with Indexing 是 Polars 中的反模式:How to parse and transform (select/filter?) a CSV that seems to require so? - Selecting with Indexing is an anti-pattern in Polars: How to parse and transform (select/filter?) a CSV that seems to require so?

我想阅读来自 Rigol MSO5000 示波器的带有 Pola-rs 的以下(非常破损,IMO)CSV: 这是我当前的 Jupyter Notebook 迭代/尝试,然后才发现在 Pola-rs 中不鼓励使用索引进行选择:import polars as pl df = pl.read_csv ...

有没有办法在 Polars 中同时对多个帧执行惰性操作? - Is there a way to perform lazy operations in Polars on multiple frames at the same time?

Polars 中的 Lazy more 和查询优化是一个很好的工具,可以节省单个数据帧的 memory 分配和 CPU 使用率。 我想知道是否有一种方法可以为多个惰性框架执行此操作: 上面的代码不会运行,因为LazyFrame没有实现除法和求反。 然而,我的目标是创建新的result_pdf框架 ...

polars 将 unix 时间戳转换为日期的本机方法 - polars native way to convert unix timestamp to date

我正在处理一些包含以毫秒为单位的 Unix 纪元的数据框,并希望将整个时间戳系列显示为日期。 不幸的是,这些文档并没有帮助我找到一种极地原生的方式来做到这一点,我在这里伸出援手。 关于如何在 Python 和 Rust 中执行此操作的解决方案会让我的头脑和一天都充满希望。 例如,对于熊猫,这样的事情 ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM