Data Science

Is Python's Pandas 2.0 fast enough to replace R's data.table for massive datasets?

B Asked by Brian Collins · 22-02-2024
0 upvotes 9,485 views 0 comments
The question

I’ve been an R user for years because data.table is incredibly fast for multi-gigabyte files. However, with the release of Pandas 2.0 and the Apache Arrow integration, I’m hearing that Python’s speed has improved significantly. For those of you handling big data on local machines, has Python finally closed the performance gap for data manipulation? 

3 answers

0
JE
Answered on 25-02-2024

While Pandas 2.0 with the Arrow backend is a massive leap forward, R’s data.table still holds the crown for memory efficiency and raw speed on large-scale in-memory operations. The syntax of data.table is much more concise for complex grouping and joining. However, the gap is definitely closing. If you are working in an environment where you need to pass data between different languages, Python’s integration with Arrow makes it much faster than it used to be. But if I have a 20GB CSV and need to do a grouped aggregation, I’m still reaching for R every single time. 

0
MI
Answered on 28-02-2024

Have you looked into Polars as a middle ground? It’s available for both languages and seems to be outperforming both Pandas and data.table in several recent benchmarks.

ST 01-03-2024

Michael, Polars is actually incredible. I’ve started using the Python version for my ETL pipelines and it’s significantly faster than Pandas for large joins. It’s written in Rust, so it handles multi-threading much better than the older Python libraries.

0
PA
Answered on 04-03-2024

Speed is important, but readability matters too. I still find the Tidyverse/Dplyr syntax in R to be the most human-readable way to describe data transformations. 

BR 06-03-2024

Readability is a major factor, Patricia. When working in teams, having code that others can easily audit and understand is often worth a slight hit in execution speed.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session