Book description
Over 70 recipes to get you started with popular Python libraries based on the principal concepts of data visualization
About This Book
- Learn how to set up an optimal Python environment for data visualization
- Understand how to import, clean and organize your data
- Determine different approaches to data visualization and how to choose the most appropriate for your needs
Who This Book Is For
If you already know about Python programming and want to understand data, data formats, data visualization, and how to use Python to visualize data then this book is for you.
What You Will Learn
- Introduce yourself to the essential tooling to set up your working environment
- Explore your data using the capabilities of standard Python Data Library and Panda Library
- Draw your first chart and customize it
- Use the most popular data visualization Python libraries
- Make 3D visualizations mainly using mplot3d
- Create charts with images and maps
- Understand the most appropriate charts to describe your data
- Know the matplotlib hidden gems
- Use plot.ly to share your visualization online
In Detail
Python Data Visualization Cookbook will progress the reader from the point of installing and setting up a Python environment for data manipulation and visualization all the way to 3D animations using Python libraries. Readers will benefit from over 60 precise and reproducible recipes that will guide the reader towards a better understanding of data concepts and the building blocks for subsequent and sometimes more advanced concepts.
Python Data Visualization Cookbook starts by showing how to set up matplotlib and the related libraries that are required for most parts of the book, before moving on to discuss some of the lesser-used diagrams and charts such as Gantt Charts or Sankey diagrams. Initially it uses simple plots and charts to more advanced ones, to make it easy to understand for readers. As the readers will go through the book, they will get to know about the 3D diagrams and animations. Maps are irreplaceable for displaying geo-spatial data, so this book will also show how to build them. In the last chapter, it includes explanation on how to incorporate matplotlib into different environments, such as a writing system, LaTeX, or how to create Gantt charts using Python.
Style and approach
A step-by-step recipe based approach to data visualization. The topics are explained sequentially as cookbook recipes consisting of a code snippet and the resulting visualization.
Table of contents
-
Python Data Visualization Cookbook Second Edition
- Table of Contents
- Python Data Visualization Cookbook Second Edition
- Credits
- About the Authors
- About the Reviewer
- www.PacktPub.com
- Preface
-
1. Preparing Your Working Environment
- Introduction
- Installing matplotlib, NumPy, and SciPy
- Installing virtualenv and virtualenvwrapper
- Installing matplotlib on Mac OS X
- Installing matplotlib on Windows
- Installing Python Imaging Library (PIL) for image processing
- Installing a requests module
- Customizing matplotlib's parameters in code
- Customizing matplotlib's parameters per project
-
2. Knowing Your Data
- Introduction
- Importing data from CSV
- Importing data from Microsoft Excel files
- Importing data from fixed-width data files
- Importing data from tab-delimited files
- Importing data from a JSON resource
- Exporting data to JSON, CSV, and Excel
- Importing and manipulating data with Pandas
- Importing data from a database
- Cleaning up data from outliers
- Reading files in chunks
- Reading streaming data sources
- Importing image data into NumPy arrays
- Generating controlled random datasets
- Smoothing the noise in real-world data
-
3. Drawing Your First Plots and Customizing Them
- Introduction
- Defining plot types – bar, line, and stacked charts
- Drawing simple sine and cosine plots
- Defining axis lengths and limits
- Defining plot line styles, properties, and format strings
- Setting ticks, labels, and grids
- Adding legends and annotations
- Moving spines to the center
- Making histograms
- Making bar charts with error bars
- Making pie charts count
- Plotting with filled areas
- Making stacked plots
- Drawing scatter plots with colored markers
-
4. More Plots and Customizations
- Introduction
- Setting the transparency and size of axis labels
- Adding a shadow to the chart line
- Adding a data table to the figure
- Using subplots
- Customizing grids
- Creating contour plots
- Filling an under-plot area
- Drawing polar plots
- Visualizing the filesystem tree using a polar bar
- Customizing matplotlib with style
- 5. Making 3D Visualizations
- 6. Plotting Charts with Images and Maps
- 7. Using the Right Plots to Understand Data
- 8. More on matplotlib Gems
- 9. Visualizations on the Clouds with Plot.ly
- Index
Product information
- Title: Python Data Visualization Cookbook - Second Edition
- Author(s):
- Release date: November 2015
- Publisher(s): Packt Publishing
- ISBN: 9781784396695
You might also like
book
Python Data Analysis Cookbook
Over 140 practical recipes to help you make sense of your data with ease and build …
book
Mastering Python Data Visualization
Generate effective results in a variety of visually appealing charts using the plotting packages in Python …
book
Python: Data Analytics and Visualization
Understand, evaluate, and visualize data About This Book Learn basic steps of data analysis and how …
book
Python Data Science Essentials - Third Edition
Gain useful insights from your data using popular data science tools Key Features A one-stop guide …