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
Mastering Python Data Visualization
Mastering Python Data Visualization

Mastering Python Data Visualization: Generate effective results in a variety of visually appealing charts using the plotting packages in Python

eBook
€22.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Mastering Python Data Visualization

Chapter 2. Data Analysis and Visualization

Most visualization stories begin with some question that is oriented towards a topic where the data is being either explored or collected. The question contains the premise to the story and leads us to the point at which the data takes an expedition over the storyline. Such data expeditions that start with a question, for example, How many Ebola deaths were reported in the year 2014? are implemented by a group of people by collaborating with each other. The role of data communicators should be to create an information experience that transforms how their audiences think about their story.

The key parts of the story relate to the process of placing the visualization in a meaningful context. The context provides knowledge that answers questions such as the following:

  • Is there sufficient data?
  • Is there a time frame within which this data exists?
  • Which associable events around the globe will influence this data?

To reiterate, it is important to...

Why does visualization require planning?

The whole process of visualization involves people with different skill sets and domain expertise. Data wranglers diligently collect data and analyze it. Mathematicians and statisticians understand the visual design principles and communicate their data using those principles. Designers or artists (in some cases, frontend developers) have the skills necessary for visualization, while business analysts look out for things like customer behavioral patterns, outliers, or a sudden unusual trend. However, it always starts with either acquiring or gathering data, and with the following steps:

  • Acquire or gather data from an external source, a website, or from a file on a disk
  • Parse and filter data using programming methods to parse, clean, and reduce the data
  • Analyze and refine to remove noise and unnecessary dimensions and find patterns
  • Represent and interact to present the data in ways that are more accessible and understandable

How much of this process is...

The Ebola example

To illustrate the steps mentioned in the previous section and how they lead to an understandable visualization, let us consider the question we had earlier, that is, How many Ebola deaths were reported in the year 2014? This particular question leads to very specific data, which is usually maintained by the World Health Organization (http://www.who.int/en/) or Humanitarian Data Exchange (https://hdx.rwlabs.org). The original source of this data is the World Health Organization (WHO), but the Humanitarian Data Exchange (HDX) is the contributor. Please note, however, that we shall have all the data, along with the Python source code examples for this book, available at a single place.

The data contains information about the spread of the Ebola disease in Guinea, Liberia, Mali, Nigeria, Senegal, Sierra Leone, Spain, United Kingdom, and the United States of America.

The contributor URL for this information is https://data.hdx.rwlabs.org/dataset/ebola-cases-2014/.

The contents...

A sports example

To illustrate another example, and how a specific visualization method works better than another, let us consider a different question: What are the top five record touchdowns by quarterbacks in American Football as of Feb 2015? The original source of data for this are the Len Dawson NFL and AFL Statistics. (Data source: http://www.pro-football-reference.com/players/D/DawsLe00.htm.)

The data contains information about the top 22 quarterbacks: Peyton Manning, Brett Favre, Dan Marino, Drew Brees, Tom Brady, Frank Tarkenton, John Elway, Warren Moon, John Unitas, Vinny Testaverda, Joe Montana, Dave Krieg, Eli Manning, Sonny Jurgensen, Dan Fouts, Philip Rivers, Ben Roethlisberger, Drew Bledsoe, Boomer Esiason, John Hadle, Tittle, and Tony Romo:

A sports example

Before we think of a visualization method, a little bit of analysis needs to be done. These quarterbacks had played in different time periods. For example, Brett Favre played from 1991 to 2010, and Dan Marino played from 1983 to 1999. The...

Creating interesting stories with data

Data visualization regularly promotes its ability to reveal stories with data, and in some cases, reveal the not so trivial stories visually. In the recent past, journalists have been integrating visualizations more into their narratives, often helping us better understand their stories. In the commercial world, there are few that grasp the ways in which data can be associated with a meaningful story that appeals both emotionally and intelligently to the audience. As Rudyard Kipling wrote, If history were taught in the form of stories, it would never be forgotten; a similar thought applies to data. We should, therefore, understand that data would be understood and remembered better if presented in the right way.

Why are stories so important?

There are many tools and methods of visualization that we have today: bar and pie charts, tables, line graphs, bubble charts, scatter plots, and so on—the list is long. However, with these tools, the focus...

Perception and presentation methods

In the past, data size and variety did not impose much of a challenge; therefore, perceiving and analyzing data was straightforward. Today there are large quantities of data in innumerable fields, and visualization can provide valuable assistance to humans for perceiving and interacting with visualization of the data. Human factors contribute significantly to the whole visualization process in order to better understand data and aid in decision-making tasks.

Visualization techniques can be categorized into two areas:

  • Scientific visualization: This involves scientific data with an inherent physical entity
  • Information visualization: This involves abstract data (spatial or non-spatial)

Most visualization systems are designed so that humans and computers can cooperate, each performing the following tasks:

  • Visually representing data to enhance data analysis
  • Visually displaying models, interpretations of data, ideas, hypotheses, and insight
  • Helping users to improve...

Why does visualization require planning?


The whole process of visualization involves people with different skill sets and domain expertise. Data wranglers diligently collect data and analyze it. Mathematicians and statisticians understand the visual design principles and communicate their data using those principles. Designers or artists (in some cases, frontend developers) have the skills necessary for visualization, while business analysts look out for things like customer behavioral patterns, outliers, or a sudden unusual trend. However, it always starts with either acquiring or gathering data, and with the following steps:

  • Acquire or gather data from an external source, a website, or from a file on a disk

  • Parse and filter data using programming methods to parse, clean, and reduce the data

  • Analyze and refine to remove noise and unnecessary dimensions and find patterns

  • Represent and interact to present the data in ways that are more accessible and understandable

How much of this process...

The Ebola example


To illustrate the steps mentioned in the previous section and how they lead to an understandable visualization, let us consider the question we had earlier, that is, How many Ebola deaths were reported in the year 2014? This particular question leads to very specific data, which is usually maintained by the World Health Organization (http://www.who.int/en/) or Humanitarian Data Exchange (https://hdx.rwlabs.org). The original source of this data is the World Health Organization (WHO), but the Humanitarian Data Exchange (HDX) is the contributor. Please note, however, that we shall have all the data, along with the Python source code examples for this book, available at a single place.

The data contains information about the spread of the Ebola disease in Guinea, Liberia, Mali, Nigeria, Senegal, Sierra Leone, Spain, United Kingdom, and the United States of America.

The contributor URL for this information is https://data.hdx.rwlabs.org/dataset/ebola-cases-2014/.

The contents...

A sports example


To illustrate another example, and how a specific visualization method works better than another, let us consider a different question: What are the top five record touchdowns by quarterbacks in American Football as of Feb 2015? The original source of data for this are the Len Dawson NFL and AFL Statistics. (Data source: http://www.pro-football-reference.com/players/D/DawsLe00.htm.)

The data contains information about the top 22 quarterbacks: Peyton Manning, Brett Favre, Dan Marino, Drew Brees, Tom Brady, Frank Tarkenton, John Elway, Warren Moon, John Unitas, Vinny Testaverda, Joe Montana, Dave Krieg, Eli Manning, Sonny Jurgensen, Dan Fouts, Philip Rivers, Ben Roethlisberger, Drew Bledsoe, Boomer Esiason, John Hadle, Tittle, and Tony Romo:

Before we think of a visualization method, a little bit of analysis needs to be done. These quarterbacks had played in different time periods. For example, Brett Favre played from 1991 to 2010, and Dan Marino played from 1983 to 1999. The...

Creating interesting stories with data


Data visualization regularly promotes its ability to reveal stories with data, and in some cases, reveal the not so trivial stories visually. In the recent past, journalists have been integrating visualizations more into their narratives, often helping us better understand their stories. In the commercial world, there are few that grasp the ways in which data can be associated with a meaningful story that appeals both emotionally and intelligently to the audience. As Rudyard Kipling wrote, If history were taught in the form of stories, it would never be forgotten; a similar thought applies to data. We should, therefore, understand that data would be understood and remembered better if presented in the right way.

Why are stories so important?

There are many tools and methods of visualization that we have today: bar and pie charts, tables, line graphs, bubble charts, scatter plots, and so on—the list is long. However, with these tools, the focus is on data...

Left arrow icon Right arrow icon

Description

Python has a handful of open source libraries for numerical computations involving optimization, linear algebra, integration, interpolation, and other special functions using array objects, machine learning, data mining, and plotting. Pandas have a productive environment for data analysis. These libraries have a specific purpose and play an important role in the research into diverse domains including economics, finance, biological sciences, social science, health care, and many more. The variety of tools and approaches available within Python community is stunning, and can bolster and enhance visual story experiences. This book offers practical guidance to help you on the journey to effective data visualization. Commencing with a chapter on the data framework, which explains the transformation of data into information and eventually knowledge, this book subsequently covers the complete visualization process using the most popular Python libraries with working examples. You will learn the usage of Numpy, Scipy, IPython, MatPlotLib, Pandas, Patsy, and Scikit-Learn with a focus on generating results that can be visualized in many different ways. Further chapters are aimed at not only showing advanced techniques such as interactive plotting; numerical, graphical linear, and non-linear regression; clustering and classification, but also in helping you understand the aesthetics and best practices of data visualization. The book concludes with interesting examples such as social networks, directed graph examples in real-life, data structures appropriate for these problems, and network analysis. By the end of this book, you will be able to effectively solve a broad set of data analysis problems.

What you will learn

  • Gather, cleanse, access, and map data to a visual framework
  • Recognize which visualization method is applicable and learn best practices for data visualization
  • Get acquainted with reader-driven narratives and author-driven narratives and the principles of perception
  • Understand why Python is an effective tool to be used for numerical computation much like MATLAB, and explore some interesting data structures that come with it
  • Explore with various visualization choices how Python can be very useful in computation in the field of finance and statistics
  • Get to know why Python is the second choice after Java, and is used frequently in the field of machine learning
  • Compare Python with other visualization approaches using Julia and a JavaScript-based framework such as D3.js
  • Discover how Python can be used in conjunction with NoSQL such as Hive to produce results efficiently in a distributed environment

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 27, 2015
Length: 372 pages
Edition : 1st
Language : English
ISBN-13 : 9781783988327
Vendor :
Anaconda
Category :
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Oct 27, 2015
Length: 372 pages
Edition : 1st
Language : English
ISBN-13 : 9781783988327
Vendor :
Anaconda
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 115.97
Python Machine Learning
€36.99
Python Data Visualization Cookbook (Second Edition)
€36.99
Mastering Python Data Visualization
€41.99
Total 115.97 Stars icon
Banner background image

Table of Contents

10 Chapters
1. A Conceptual Framework for Data Visualization Chevron down icon Chevron up icon
2. Data Analysis and Visualization Chevron down icon Chevron up icon
3. Getting Started with the Python IDE Chevron down icon Chevron up icon
4. Numerical Computing and Interactive Plotting Chevron down icon Chevron up icon
5. Financial and Statistical Models Chevron down icon Chevron up icon
6. Statistical and Machine Learning Chevron down icon Chevron up icon
7. Bioinformatics, Genetics, and Network Models Chevron down icon Chevron up icon
8. Advanced Visualization Chevron down icon Chevron up icon
A. Go Forth and Explore Visualization Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(4 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
Math Review Nov 17, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I have not completely read the book yet, I liked the examples in sports and Monte Carlo Simulations.
Amazon Verified review Amazon
Oleg Okun Dec 06, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
As its title says, this book is about exploration of data visualization in Python. The author approaches to this task by not only featuring the available Python functionality to visualize data, but by putting it into the context of "visualization of information for knowledge inference". In his words, this means not the visualization per se, but knowledge discovery aimed visualization which is the integral part of data science related projects. With this goal in mind, the author conveys readers through a number of real-world stories (taken from finance, sports, bioinformatics, natural language processing) accompanied by plots of various kinds.As a Python distribution, Anaconda is chosen as it includes many pre-installed packages. As any knowledge discovery assumes data processing and analysis, the discussion is also on numpy, scipy, matplotlib, scikit-learn, NetworkX, bokeh, IPython, plotly and a few others less commonly known packages as well as on their application to the book main topic.The book presumes some background knowledge of Python from readers and therefore it is best suitable for those who have exposure to Python programming but wants to acquire data visualization skills, meaning the typical job titles of a data analyst or a data engineer.
Amazon Verified review Amazon
yoalieh Dec 09, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I liked this book, though it's not easy to be loved.I'd liked the introduction a lot, as the author talked about data visualization as a discipline, and gave some tips and ideas of diferent kind of visualizations (There's is a lot more than graph bars and scatterplots it seems, ;) ). It tries to be discipline-agnostic by using many real life examples from many disciplines. I think this can bring inspiration when in need of a way to present information hard to explain.After that, when talking about Python, it gives an overview about Python versions and libraries which can simplify the process of creating good visualizations. Finally, almost all examples are based in Conda, but still other things are used. This can cause a bit of confussion, but I see it as one of the potential of this book, as it can be used as reference to create good visualizations in different workflows, and serves as a reference about which libraries can be used for a special kind of visualization if it's not covered by one of them.The examples in further chapters are very good, and I loved when it talks about Numpy, simulation, or advanced data structures, all of which can be used to create better visualization, or even the part talking about drawing graphs.Don't expect this book to be a cookbook, it's more like a big notebook of a professional in charge of creating a LOT of visualizations for different fields. I think it lacks a bit of more explaining on some specfic examples or libraries, but that would require a lot more books to fit them. Also, a very good level of Python understanding, and documentation for each library in use is not only recommended, but a must.
Amazon Verified review Amazon
Amazon Customer Dec 12, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
[Disclaimer: Packt Publishing asked me to review the book in light of my Github public profile. I was given complete editorial freedom and NOT compensated in anyway for the review however]Overall, I enjoyed this book, although I suspect it's real value will become apparent when I return to it over the next few years when faced with visualising tricky datasets. Broadly, Kirthi Raman covers three areas: Introducing visualisation as an activity itself (he considers it a form of story telling), several Python tools for visualisation and analytic techniques that can drive the visualisation/modelling process. I particularly like that a plethora of approaches are encouraged, so that if you find one isn’t suited to what you’re doing, there are always plenty other to consider. As someone who uses Python on a daily basis to both model and visualise a variety of data sources, Raman's book is an important addition to my professional library.Where I find the book lacking is in providing a clear path to applying the array of techniques and packages suggested. To be clear, there are good code examples for almost every visualisation/analytic technique (the financial models are particularly well explained), but I would have liked more explanation/worked examples of going from a raw dataset to a professional visualisation.Another minor criticism is that it is quite ambitious in its scope (there are whole journals devoted to some of the modelling techniques covered in a few pages), but by making the reader aware of these approaches, the reader can always read further.To end on a practical note, I like that the publisher makes the book available in multiple formats, including Kindle and DRM-free PDF. This is very practical for reading (and using) the book over multiple devices. I would recommend a colour display though, so as to enjoy the full effect of the many visualisation examples.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.