O'Reilly logo

Python Data Analysis by Ivan Idris

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

Plotting in pandas

The plot() method in the pandas Series and DataFrame classes wraps around the related matplotlib functions. In its most basic form without any arguments, the plot() method displays the following plot for the dataset we have been using throughout this chapter:

Plotting in pandas

To create a semi-log plot, add the logy parameter:

df.plot(logy=True)

This results in the following plot for our data:

Plotting in pandas

To create a scatter plot, specify the kind parameter to be scatter. We also need to specify two columns. Set the loglog parameter to True to produce a log-log ...

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