Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
0 answers
51 views

I want to sum up (horizontally) some columns that share a common string in their name. For example, given the following columns a_red, a_blue, a_green, b_red, b_yellow, b_blue I would like to add in ...
Xywa's user avatar
  • 1
Best practices
0 votes
0 replies
19 views

I've been working on a project for rapidly testing thousands of outcome variables on a standard set of predictors and covariates using polars. It's working very well, with speed ups as high as 16x ...
idins23's user avatar
  • 11
2 votes
1 answer
82 views

I have a polars dataframe with a date column I've built with the format %YW%W. I want to convert the column to a date, so I wrote the following snippet: agg_pivoted_df = pivoted_df.with_columns([ ...
Pollastre's user avatar
  • 338
2 votes
1 answer
194 views

I have a JSON file that I'm trying to read into a Polars dataframe but keep getting an error message. I've been able to pin it to a specific character, but I don't know what to do about it. JSON file ...
simplycoding's user avatar
  • 3,059
2 votes
1 answer
98 views

Suppose I have the following DataFrame of the number of births in each state in each year: df = pl.DataFrame( { "state": ["CA", "CA", "CA", "TX&...
robertspierre's user avatar
Advice
0 votes
3 replies
79 views

If I have a polars dataframe like ┌───────────┬─────────────────────┬───────────┐ │ sensor_id ┆ ts ┆ value │ │ --- ┆ --- ┆ --- │ │ i32 ┆ datetime[...
Glenn Pierce's user avatar
5 votes
1 answer
144 views

Consider the following DataFrame: df = pl.DataFrame({ "a":[ ["55", "87.19"], ["55.11","55.12"], ["55", "27.89"] ...
robertspierre's user avatar
4 votes
1 answer
116 views

Consider a DataFrame with multiple list columns, for instance: df = pl.DataFrame({ "a": [range(1,3), range(5,10)], "b": [range(4,9), range(6,11)] }) Let's print it: ...
robertspierre's user avatar
0 votes
1 answer
119 views

I’m reading an XLSX file uploaded from a React frontend to a FastAPI backend. On the frontend, I use the xlsx library to read and display the data as JSON: reader.onload = (evt) => { const data = ...
loremus's user avatar
  • 295
0 votes
1 answer
135 views

I'm having a lot of problems in the interaction between uv, Polars, and Visual Studio Code. I run my Polars code within a virtual environment built with uv. Sometimes the kernel just dies. Sometimes a ...
robertspierre's user avatar
Advice
0 votes
2 replies
82 views

I have a large table of data, in the range of hundreds of millions of rows/events, each which has around 50 numerical columns, call them c1 through c50. For each event, say I want to perform matrix-...
DiracComb16796's user avatar
2 votes
2 answers
137 views

Suppose I have the following polars DataFrame: df = pl.DataFrame({"a": [["A111", "A110"], ["Z254"], ["B897", "C768", "D456"]]}) ...
robertspierre's user avatar
2 votes
1 answer
87 views

The documentation for polars.Expr.list.agg says: Run any polars aggregation expression against the lists’ elements. One would think that the "aggregation expression"s the documentation ...
robertspierre's user avatar
4 votes
1 answer
154 views

I am trying to filter out the URI column from a parquet file having over 50 million rows containing empty string using import polars as pl lf = pl.scan_parquet("data.parquet") lf.filter(pl....
srajan0149's user avatar
0 votes
0 answers
122 views

I am performing a series of left joins on Polars LazyFrames: final_df = ( lf1.join(lf2, on="id", how="left") .join(lf3, on="id", how="left") ....
Salim DEBBAOUI's user avatar

15 30 50 per page
1
2 3 4 5
190