mathstodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance for maths people. We have LaTeX rendering in the web interface!

Server stats:

2.8K
active users

#polars

2 posts2 participants0 posts today

If anyone is looking at using #polars for dataframes in #rust , having done it myself for a few months at work, here are my thoughts:

1. It works and it's fast. I'd use it again.
2. The /rust-specific/ documentation is really barebones. However, the python docs are good, so you can read those and the translation isn't too bad. However, this is definitely the largest pain point.

If anyone has any questions about using the crate, feel free to ask and I'll answer if I can!

🌊  Kisters provides real-time flood warnings—but traffic spikes made scaling costly. We helped them build a Rust-based system using Polars to process data efficiently across servers, edge, and browsers (WASM)—keeping performance high and costs low.

Read more ➡️ mainmatter.com/cases/kisters/?

MainmatterDynamically switching execution platforms with Rust | Work - Mainmatter
More from Mainmatter

At last night’s @mug meeting we looked at a lot of different solutions to #adventofcode day 1 in many different languages. Two that were very interesting to me were #Zig and #haskell. The way these two languages worked was really quite fascinating. After seeing real code in these two languages, I can tell they are not for me; but they were interesting and illuminating nonetheless.

There was a solution entirely in #SQL. Another in #vim9script. Another in #swiftlang #swift (I don’t think that one’s in the repo yet). I wrote several implementations myself. The one I felt most proud of is #Python with the core written in #rustlang #rust tied together with #PyO3. The one I felt was maybe the best tool for the job was entirely based on #pandas. As I said in a previous post, I tried to solve it in #polars, but the API exposed by Polars at least as far as I could tell, made it no better than simple lists in Python. I need to get deeper knowledge here.

The repo lives here: github.com/MichiganUnixUserGro.

Not sure exactly when we will discuss this, but the problems are from the 2024 Advent of Code - MichiganUnixUserGroup/MUG-2025-03-11-Advent-of-Code
GitHubGitHub - MichiganUnixUserGroup/MUG-2025-03-11-Advent-of-Code: Not sure exactly when we will discuss this, but the problems are from the 2024 Advent of CodeNot sure exactly when we will discuss this, but the problems are from the 2024 Advent of Code - MichiganUnixUserGroup/MUG-2025-03-11-Advent-of-Code

There are now so many "backends" for {dplyr}—duckdb with {duckplyr}, polars with {tidypolars}, various database engines with {dbplyr}, {data.table} with {dtplyr}. Is there a blog post or flow chart somewhere with pros and cons of each? Like, comparisons of memory requirements, speed, and how likely they are to "just work"?

"Plotando estatísticas básicas com #Polars e #Matplotlib - #NLP 04 " @dunossauro #Python

youtube.com/watch?v=4HpSFIekqD

Hoje eu aprendi uma ideia ótima do Dunossauro que é imaginar que o ax do fig, ax do matplotlib (axis/eixo) é como uma haste onde penduramos as coisas! Como é fundamental o trabalho dele pra nossa comunidade.

Update: inicialmente achei que era uma tradução corrente mas ele me explicou que não.

Does anyone have advice for unit testing a Polars Python expression? Say I have:

def my_func(a, b):
return (pl.col(a) / pl.col(b))

How do you unit test? We want to compare the result of this function to an expectation. At the moment we’re wrapping the result in str(), which gives us a stringified version of the expression. Then we assert that it is equal to the stringified expression that we would expect.

It works, just feels a little bit fragile. Unfortunately you can’t compare expressions directly with the equality operator ==. And polars.testing doesn’t have asserts for it either.

(We are of course also going to have integration tests, where the expression actually gets used on a df fixture)

@jeroenhjanssens
#Polars #Python #PyData

Une auteure de #polars à suivre assurément. J’en ai lu plusieurs d’elle, dont « Block 46 ». Voici son « dernier » sorti.
Je ne gagne absolument rien à faire sa pub, je suis juste une personne qui aime ce qu’elle #écrit et représente. Une bien belle personne.

Just caught up with the recent Delta Lake webinar,

> Revolutionizing Delta Lake workflows on AWS Lambda with Polars, DuckDB, Daft & Rust

Some interesting hints there regarding lightweight processing of big-ish data. Easy to relate to any other framework instead of Lambda, e.g. #ApacheAirflow tasks

youtu.be/BR9oFD0QMAs

youtu.be- YouTubeEnjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.

Lots of #rustlang over the weekend. Lots of stuff to say. I’m writing small programs (mostly #adventofcode) with lots of looking stuff up. Looking stuff up shows me just how much _more_ Rust there is to know. Rust chained iterator expressions can do everything a #Python list #comprehension can do. I use #pandas all the time. #polars is data compatible and you can call it from Rust. This could help me in my job. The way you implement methods in Rust is _so_ much like type-bound procedures in #oberon2. I have more and more respect for Rust. I still love Python.

Recently I've been working on getting #polars running in #pyodide. This was a fun one, even requiring patches to LLVM's #wasm writer! Everything has now been upstreamed and earlier this week Pyodide v0.27.0 released, including a Wasm build of Polars usable in the Pyodide REPL, Shinylive and Quarto Live 🎉