-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BLOG: The "Polars vs pandas" difference nobody is talking about #843
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -0,0 +1,167 @@ | |||
--- | |||
title: 'The "Polars vs pandas" difference nobody is talking about' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: 'The "Polars vs pandas" difference nobody is talking about' | |
title: 'The Polars vs pandas difference nobody is talking about' |
|
||
# The "Polars vs pandas" difference nobody is talking about | ||
|
||
I attended PyData Berlin 2024 this week, and it was a blast! I met so many colleagues, collaborators, and friends. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"this week"?
category: [PyData ecosystem] | ||
--- | ||
|
||
# The "Polars vs pandas" difference nobody is talking about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# The "Polars vs pandas" difference nobody is talking about | |
# The Polars vs pandas difference nobody is talking about |
- lazy execution; | ||
- Rust; | ||
- consistent handling of null values; | ||
- multithreading; | ||
- query optimisation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- lazy execution; | |
- Rust; | |
- consistent handling of null values; | |
- multithreading; | |
- query optimisation. | |
- lazy execution | |
- Rust | |
- consistent handling of null values | |
- multithreading | |
- query optimisation |
|
||
If we want a single scalar value per group, we can use a reduction ('mean', 'sum', 'std', ...): | ||
```python | ||
df.group_by('a').agg(pl.sum('b')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm already a little lost. Is this Polars or pandas?
This isn't too bad, but it involves doing two group-bys, and so is at least twice as slow as it could | ||
be. | ||
|
||
Finally, can rely on `GroupBy` caching its groups, in-place mutation of the original dataframe, and the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, can rely on `GroupBy` caching its groups, in-place mutation of the original dataframe, and the | |
Finally, we can rely on `GroupBy` caching its groups, in-place mutation of the original dataframe, and the |
|
||
is a common refrain among Polars users. | ||
|
||
There may be a more general lesson here: if you have the courage to do things differently, you may be rewarded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line doesn't really connect for me with anything else in the blog post, seems to come out of nowhere.
There may be a more general lesson here: if you have the courage to do things differently, you may be rewarded. | ||
|
||
If you'd like to learn about how to use Polars effectively, or how to solve problems in your organisation | ||
using Polars, Quansight is here to help - you can get in touch [here](https://quansight.com/about-us/#bookacallform). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there's some way we could or should set this off from the rest of the blog post, something like the following (not saying we should do it exactly like this):
And now, a small message from our fellow coworkers at Quansight Consulting... If you'd like to learn about how to use Polars effectively, or how to solve problems in your organisation
using Polars, please get in touch.
Note: I changed the base branch of this PR to reflect the new blog publishing process. Once this is approved, it will be merged directly into the main branch and deployed live to the Web. |
Text styling
Non-text contents