CloudyML

DATA SCIENCE WORLD

Modin
A Feather To Pandas

What? Pandas? Are you Kidding me? Who doesn’t know that?

Wait-wait-wait…..

Modin? What the heck is that?

Let’s check it out!

What is Modin? Why does it matter?

Modin is a python library that can be used to replace pandas while dealing with large dataset processing. It uses Ray or Dask to speedup pandas notebooks, scripts, and libraries. Modin provides seamless integration and compatibility with existing pandas code. It is capable of speeding up pandas scripts up to 4x.

Modin enables us to use all the CPU cores available in our machine, unlike pandas. When we run the same code with 4 processors instead of one, the time taken decreases significantly.

What went wrong with Pandas?

Since its invention, Pandas has always been the most popular python library for data analysis. The main reason behind its success has been its neat and easy API, leveraging which all of has have enjoyed over the time.

But there’s always the other side of the coin.

As long as the data we work with is small, pandas is amazing. But often, in reality, we have to deal with much larger datasets in the size of several terabytes or larger. In such cases, pandas may not work that efficiently. Pandas is designed in such a way that it works only on a single core. Even though most of our machines have multiple CPU cores, Pandas cannot leverage them all.

What else?

  1. Modin is an extremely light-weight and robust DataFrame.
  2. It’s super compatible with the pandas code which makes it more user-friendly.
  3. Internal working of CPU or RAM isn’t required to use Modin effectively.
  4. Having similar APIas pandas, Modin provides the best of both: Speed and convenience.
  5. Modin aims to be the one tool for all dataframes from 1 MB To 1 TB+ of data.

Now that was Interesting…..

Refer the original documentation for in-depth study: Click Here

I hope you enjoyed the article and understood how to use Modin to speed up your pandas code. I’m sure you’ll start leveraging Modin just after finishing this blog. I hope it saves a lot of your time. Stay tuned for more such articles.

Our Popular Data Science Course

Scroll to Top