Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering pandas

You're reading from   Mastering pandas A complete guide to pandas, from installation to advanced data analysis techniques

Arrow left icon
Product type Paperback
Published in Oct 2019
Publisher
ISBN-13 9781789343236
Length 674 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ashish Kumar Ashish Kumar
Author Profile Icon Ashish Kumar
Ashish Kumar
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Section 1: Overview of Data Analysis and pandas
2. Introduction to pandas and Data Analysis FREE CHAPTER 3. Installation of pandas and Supporting Software 4. Section 2: Data Structures and I/O in pandas
5. Using NumPy and Data Structures with pandas 6. I/Os of Different Data Formats with pandas 7. Section 3: Mastering Different Data Operations in pandas
8. Indexing and Selecting in pandas 9. Grouping, Merging, and Reshaping Data in pandas 10. Special Data Operations in pandas 11. Time Series and Plotting Using Matplotlib 12. Section 4: Going a Step Beyond with pandas
13. Making Powerful Reports In Jupyter Using pandas 14. A Tour of Statistics with pandas and NumPy 15. A Brief Tour of Bayesian Statistics and Maximum Likelihood Estimates 16. Data Case Studies Using pandas 17. The pandas Library Architecture 18. pandas Compared with Other Tools 19. A Brief Tour of Machine Learning 20. Other Books You May Enjoy

Pandas plotting

A picture is worth a thousand words. This is why graphs are commonly used to visually illustrate relationships in data. The purpose of a graph is to present data that is too numerous or complicated to be described adequately in terms of text and in less space. With Python's plotting function, it takes far less than a few words of code to create a production-quality graphic.

We will begin by installing the necessary packages:

import pandas as pd 
import numpy as np 

We are using the mtcars data here to explain the plots:

mtcars = pd.DataFrame({ 
        'mpg':[21,21,22.8,21.4,18.7,18.1,18.3,24.4,22.8,19.2], 
        'cyl':[6,6,4,6,8,6,8,4,4,4], 
        'disp':[160,160,108,258,360,225,360,146.7,140.8,167.7], 
  'hp':[110,110,93,110,175,105,245,62,95,123],    
'category':['SUV','Sedan',&apos...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image