O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Performance benefits of stacked data

Finally, we will examine why we would want to stack data. It can be shown that stacked data is more efficient than using lookup through a single level index and then a column lookup, or even compared to an .iloc lookup that specifies the row and column by location. The following demonstrates this:

This can have extreme benefits on an application performance if it is required to repeatedly access a large number of scalar values out of a DataFrame.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required