sigmoid.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A social space for people researching, working with, or just interested in AI!

Server stats:

602
active users

#polars

2 posts2 participants0 posts today

New blog post: Comparing Advent of Code 2024 day 1 part 1 solutions in base R and Python Polars.

jimgar.github.io/posts/cpd-jul

Did a bit of CPD with my team at work this week. We revisited the first problem from Advent of Code 2024. Last year I solved it using base R, so I decided to use Python Polars this time and compare the outputs.

Along the way I got a tiny bit more familiar with using uv, and I finally had to learn what structs are in Polars! Turns out they're pretty simple to understand.

jimgar.github.ioCPD for July 2025 – ~ jimA grab bag of stuff

Unas semanas bien pesadas, pero con cosas interesantes que he probado en el trabajo.
- #polars : Definitivamente mi herramienta para dataframes por defecto, después de habituarse a las formas nativas esto es muy claro y eficiente.
- Depurador de #zed: Aunque no he podido lograr que funcione la forma de anexar un proceso en ejecución, el modo de lanzar proceso resulta muy directo, y la interfaz para explorar las variables y la consola de interacción integrada funcionan muy bien
#python #mastodevs

Picked up "Python Polars the definitive guide" by Jeroen Janssens and Thijs Nieuwdorp. The polar bear was already used on another O'Reilly book, but the Iberian lynx is cool.

Never sure how tech books will pan out, but Jeroen's book data science at the command line was a good one, so I am hopeful.

Anybody using the narwhals #python package for #dataframe manipulations?

Very comfortable with #pandas and #polars syntax, but although #narwhals is supposed to be very close to polars, it is a subset and I find that there is a lot of basic stuff missing. Trying to figure out how to get the first part of a str.split.

in pandas I just add .str[0] and in polars .list.get(0)

with narwhals neither approaches are implemented. Any idea as what is supported in narwhals to do this?
#programming

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.

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.