Questions tagged [rust-polars]
The rust-polars tag has no usage guidance.
rust-polars
361
questions
-1
votes
1
answer
41
views
Reading a specific value based on an indexed dataframe in rust with polars
I am trying to read a value from a dataframe based on index and column on rust. I do not know how to create an indexed dataframe. I have been unable to find much information on this. For instance, if ...
1
vote
1
answer
48
views
can I use comparison operators overloaded from Rust PartialOrd and PartialEg in Polars in Rust programs?
Below is a Quote from the Operators section in the Polars manual:
In Rust and Python it is possible to use the operators directly (as in + - * / < >) as the language allows operator overloading....
0
votes
0
answers
50
views
Polars: Collect errors per cell value
I am doing some column transformations in polars using expression API functions.
If there are errors while performing those functions, an polars error is raised like
Failed to do ... for 4000 of 9000 ...
1
vote
1
answer
47
views
How to enable only a subset of Polars' crate features?
I am using Polars in Rust. I have noticed that compile times drop significantly and give a smaller binary when using the polars-core crate instead of the polars crate. However, it's discouraged to use ...
1
vote
1
answer
56
views
Avoid clone when re-using a Rust Polars DataFrame? [duplicate]
I am trying to implement a bias-corrected accelerated confidence interval in Rust. My metric function takes in a Rust dataframe and does some operations on it to return an f64. In the example below, ...
0
votes
0
answers
36
views
Does polars for Rust support NewType datatypes?
I am looking to use the polars crate for Rust but with custom datatypes that are effectively transparent new-type wrappers around supported primitives.
Here is a simple example of what I'm trying to ...
2
votes
2
answers
104
views
Duckdb sql and postgres results differ when using unnest
I have a table in postgres and basically i'm trying to duplicate rows based on the delimiter @ in the description column. Here is my table:
txn_id
description
3332654
[email protected]@0.9397@$10.64@THB@150....
-1
votes
0
answers
75
views
Nulls imputation with Rust Polars dataframe takes significantly longer than with Pandas / Python
I benchmark the imputation of null values with zeroes in a large dataframe saved as parquet file. The steps of the test are:
Read a ~800Mb parquet file which stores a dataframe with 10000x10000 ...
0
votes
1
answer
96
views
How to parse and filter a string column in Rust Polars?
I have a DataFrame with a string column that looks like this:
let df = df!(
"names" => &["None", "0", "1", "15", "1|2", &...
0
votes
0
answers
33
views
How to configure the MatchKind of the Aho-Corasick algorithm in the replace_many function
From polars sources, I found that
fn build_ac(patterns: &StringChunked, ascii_case_insensitive: bool) -> PolarsResult<AhoCorasick> {
AhoCorasickBuilder::new()
....
2
votes
1
answer
77
views
Polars custom checks being called twice in schema validation
I believe this is an issue either within python polars or potentially rust polars.
I'm using pandera with the polars backend. While running my schema validation with cProfile, I noticed that all my ...
-1
votes
1
answer
49
views
What is the idiomatic way to operate on a single Series within a DataFrame in rust polars?
I am a beginner and want to understand if my code is idiomatic polars rust.
I have written the following function:
fn transform_str_to_tb(s: Series) -> Series {
s.iter()
.map(|v| {
...
3
votes
0
answers
69
views
Expanding function based on daily groups in polars
I have an OHLC stock data in a Polars dataframe for which for each day i want to calculate the maximum expanding close between two times say ,
start = '09:15'
end = '10:15'
start_time = datetime.time....
0
votes
0
answers
107
views
Evaluate expression in polars
How do you evaluate an expression in Rust polars without destroying the dataframe?
For example, I have an expression, for example sum(col('a') + col('b')) * col('c'), and I want to evaluate the ...
0
votes
1
answer
59
views
How to fix "cannot return value referencing local variable" error?
I have read some answers to similar questions and still couldn't find an answer that fits my situation. I understand the problem here (I practically return dangling references) but because I use an ...