O'Reilly logo

Practical Data Science Cookbook by Abhijit Dasgupta, Benjamin Bengfort, Sean Patrick Murphy, Tony Ojeda

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

Analyzing automobile fuel efficiency over time with Python

In this recipe, we are going to look at some of the fuel efficiency metrics over time and in relation to other data points. To do so, we are going to have to replicate the functionality of two very popular R libraries, which are plyr and ggplot2, in Python. The split-apply-combine data analysis capabilities that are so handily covered by the plyr R library are handled equally well but in a slightly different fashion by pandas right out of the box. The data visualization abilities of ggplot2—an R library implementation of the grammar of graphics—are not handled as readily, as we shall see in this recipe.

Getting ready

If you've completed the previous recipe, you should have almost everything ...

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