Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Pandas
  • Table Of Contents Toc
Learning Pandas

Learning Pandas

By : Michael Heydt
3.5 (2)
close
close
Learning Pandas

Learning Pandas

3.5 (2)
By: Michael Heydt

Overview of this book

If you are a Python programmer who wants to get started with performing data analysis using pandas and Python, this is the book for you. Some experience with statistical analysis would be helpful but is not mandatory.
Table of Contents (16 chapters)
close
close

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 chart in order to give a side-by-side comparison:

In [11]:
   # plot MSFT vs AAPL on the same chart
   close_px[['MSFT', 'AAPL']].plot();

The output is seen in the following screenshot:

Plotting time-series prices

Plotting volume-series data

Volume data can be plotted using bar charts. We first need to get the volume data, which can be done using the pivotTickersToColumns() function created earlier:

In [12]:
   # pivot the volume...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Pandas
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon