Chapter 7. Pandas, Dask, and Polars
Many scientific and data science projects use tabular-shaped data that fits into a dataframe. A dataframe typically collects a heterogeneous (i.e., mixed) collection of datatypes where the datatypes are assigned to columns. Each entry in the dataframe is a row—generally they look like a spreadsheet that you might see in Excel.
Pandas was released in 2008 and quickly became the main dataframe library in the Python ecosystem. As it evolved, a lot of shortcomings were discussed, as later documented in Wes McKinney’s infamous 2017 blog post “Apache Arrow and the ‘10 Things I Hate About pandas’”. At the time of this writing, eight years after that blog post, Pandas is still the most popular Python dataframe library. In the following sections we discuss some of the common ways of writing slow—or fast—Pandas solutions.
Dask, first introduced in 2014, is more than a dataframe library. It is a distributed computing framework for scientific applications—the most famous component is the distributed dataframe, which wraps the Pandas ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access