@marcogorelli.bsky.social
210 followers 200 following 69 posts
Senior Software Engineer at Quansight Labs Pretty focused on Narwhals and Polars these days, generally interested in dataframes and time series
Posts Media Videos Starter Packs
marcogorelli.bsky.social
🌝 The next @astropy.org release will support generic dataframe tables (like @pola.rs )

🌊🦄 Powered by Narwhals
PR of Astropy using Narwhals
marcogorelli.bsky.social
💡 Life-pro-tip: enable inline type hints

🏷️ Your editor will display inferred types for variables you haven't annotated

🕵️ Debugging those red squiggly lines will become much easier
Demo of inlay hints with Narwhals Enabling inlay hints in vscode
marcogorelli.bsky.social
polars Series implement __array__, I'd have thought that a lot of the time you can pass Series as then they'll be converted by any `np.asarray` call. at least passing Polars Series to matplotlib works like that
marcogorelli.bsky.social
which stats packages are tied to pandas?
marcogorelli.bsky.social
✨🐼 Pandas 3.0 will have `pd.col` syntax

💡 You can use it for clean chaining in `assign` and `loc`

🚀 It's happening, the PR just got merged!
Demo of pd.col
marcogorelli.bsky.social
✨ New @pola.rs feature - you can now chain `name` expressions!

🌊🦄 As of Narwhals 2.0 (yes, we've released 2.0 🚀), this feature is available there as well! Little example below with our friend @duckdb.org
Example of `.name` chaining with Polars Example of `.name` chaining with Narwhals
marcogorelli.bsky.social
💡 "There's nothing for permanent than a temporary fix"

Case in point, this pandas comment which was added [checks git log] ... 12 years ago 🙈
temporary solution added to pandas 12 years ago
Reposted
michaelemann.bsky.social
"If the U.S. can't get its greenhouse emissions under control, they need to face real consequences" said the rest of the world.
marcogorelli.bsky.social
💡 Today in open source: a 17-year-old NumPy commit promising that a new feature will be coming soon

Any day now..
Screenshot of 17-year-old commit message in NumPy
marcogorelli.bsky.social
😍 @posit.co have done it again

🧙 gt-extras offers even more functionality for their table renditions of @pola.rs and pandas dataframes!

🌊🦄 Using Narwhals for some dataframe logic
gt-extras demo
marcogorelli.bsky.social
💡 Solution: use Narwhals for universal dataframe support 🌊🦄
Meme of panicked Astronomer CEO caught on cam with the head of HR, with "When you find a new data science library" and "When you realise it only supports pandas" text overlaid
marcogorelli.bsky.social
✨ New Formulaic release (1.2), featuring native support for @pola.rs !

🌊🦄 Powered by Narwhals
Demo of Formulaic with native Polars support
marcogorelli.bsky.social
🎢 When the Q&A goes off-script 🤣

🇯🇵 Japanese math rock, 🅿️ porpoises and unfortunate aliases, and 🎤 Taylor Swift:

🥈All of these unexpectedly came up in this fun session, which is currently the 2nd most viewed of the conference

🙏 Thanks @pydatalondon.bsky.social for inviting me!
Marco Gorelli - How Narwhals brings Polars, DuckDB, PyArrow, & pandas together | PyData London 25
YouTube video by PyData
youtu.be
marcogorelli.bsky.social
🥳 The next version of @mlflow.org will support @pola.rs !

😩 Slightly disappointingly, they do so by converting to pandas

🌊🦄 Could Narwhals help make MLFlow gain native support for Polars? Link to the discussion below 👇
MLFlow maintainer announcing that they merged the Polars dataset PR
marcogorelli.bsky.social
🙀 It's scary to merge a 2,000+ line PR!

😇 But, this one was so thorough that we just had to ship it

🏆 Thanks to an incredible effort by Ryan Whitten, Narwhals supports Ibis!

💡You can now use Narwhals with all of Ibis' backends, plus some extra, whilst keeping @pola.rs expressive API!
PR which added Ibis support to Narwhals Demo of Ibis via Narwhals
marcogorelli.bsky.social
@pola.rs now supports `list.filter`

🪄 The `list` namespace is now even more turbocharged ⚡

👇 Full release notes for 1.30
Demo of `list.filter` in Polars
marcogorelli.bsky.social
sometimes that's all you need 😀
marcogorelli.bsky.social
✨ PySpark 4.0 is out

🌊🦄 And it's already supported by Narwhals, including PySpark connect (thanks Francesco Bruzzesi!)
Example of using PySpark via Narwhals
marcogorelli.bsky.social
Looks like a good decision, given she committed fraud