O'Reilly logo

Learning pandas 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

Plotting time-series prices

We will perform a graphical comparison of the closing values for AAPL and MSFT. Using the closing prices DataFrame, it is simple to plot the values for a specific stock using the .plot() method of Series. The following plots the adjusted closing price for AAPL:

In [9]:
   # plot the closing prices of AAPL
   close_px['AAPL'].plot();
Plotting time-series prices

The following code plots the adjusted closing price for MSFT:

In [10]:
   # plot the closing prices of MSFT
   close_px['MSFT'].plot();
Plotting time-series prices

Both sets of closing values can easily be displayed on a single ...

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