logo资料库

Learning Python Data Visualization.pdf

第1页 / 共212页
第2页 / 共212页
第3页 / 共212页
第4页 / 共212页
第5页 / 共212页
第6页 / 共212页
第7页 / 共212页
第8页 / 共212页
资料共212页,剩余部分请下载后查看
Cover
Copyright
Credits
About the Author
About the Reviewers
www.PacktPub.com
Table of Contents
Preface
Chapter 1: Setting Up Your Development Environment
Introduction
Setting up Python on Windows
Installation
Exploring the Python installation in Windows
Python editors
Setting up Python on Mac OS X
Setting up Python on Ubuntu
Summary
Chapter 2 : Python Refresher
Python basics
Importing modules and libraries
Input and output
Generating an image
Creating SVG graphics using svgwrite
For Windows users using VSPT
For Eclipse or other editors on Windows
For Eclipse on Mac and Linux
Summary
Chapter 3 : Getting Started with pygal
Why use pygal?
Installing pygal using pip
Installing pygal using Python Tools for Visual Studio
Building a line chart
Stacked line charts
Simple bar charts
Stacked bar charts
Horizontal bar charts
XY charts
Scatter plots
DateY charts
Summary
Chapter 4 : Advanced Charts
Pie charts
Stacked pie charts
Radar charts
Box plots
Dot charts
Funnel charts
Gauge charts
Pyramid charts
Worldmap charts
Summary
Chapter 5 : Tweaking pygal
Country charts
Parameters
Legend at the bottom
Legend settings
Label settings
Chart title settings
Displaying no data
pygal themes
Summary
Chapter 6 : Importing Dynamic Data
Pulling data from the Web
The XML refresher
RSS and the ATOM
Understanding HTTP
Using HTTP in Python
Parsing XML in Python with HTTP
About JSON
Parsing JSON in Python with HTTP
About JSONP
JSONP with Python
Summary
Chapter 7 : Putting It All Together
Chart usage for a blog
Getting our data in order
Converting date strings to dates
Using strptime
Saving the output as a counted array
Counting the array
Python modules
Building the main method
Modifying our RSS to return values
Building our chart module
Building a portable configuration for our chart
Setting up our chart for data
Configuring our main function to pass data
Project improvements
Summary
Chapter 8 : Further Resources
The matplotlib library
Installing the matplotlib library
matplotlib's library download page
Creating simple matplotlib charts
Plotly
Pyvot
Summary
Appendix: References and Resources
Links for help and support
Charting libraries
Editors and IDEs for Python
Other libraries and Python alternative shells
Index
Learning Python Data Visualization Master how to build dynamic HTML5-ready SVG charts using Python and the pygal library Chad Adams BIRMINGHAM - MUMBAI
Learning Python Data Visualization Copyright © 2014 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: August 2014 Production reference: 1180814 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78355-333-4 www.packtpub.com Cover image by Sabine Mehlstäubl (sabine@blumen-schmidl.de)
Credits Project Coordinator Neha Thakur Proofreaders Simran Bhogal Maria Gould Ameesha Green Indexers Hemangini Bari Tejal Soni Priya Subramani Production Coordinator Shantanu Zagade Cover Work Shantanu Zagade Author Chad Adams Reviewers Aniket Maithani Atmaram Shetye Giuseppe Vettigli Ron Zacharski Commissioning Editor Akram Hussain Acquisition Editor Joanne Fitzpatrick Content Development Editor Parita Khedekar Technical Editor Venu Manthena Copy Editors Janbal Dharmaraj Insiya Morbiwala Sayanee Mukherjee Aditya Nair Deepa Nambiar Stuti Srivastava
About the Author Chad Adams is a web and mobile software developer based in Raymore, Missouri, where he works as a mobile frontend architect creating visually appealing application software for iOS, Windows Phone, and the Web. He also creates project build systems for large development teams using programming languages such as Python and C#. He has a B.F.A. in Commercial Art and a Microsoft certification in HTML5, JavaScript, and CSS3. He has also spoken at conferences on topics that include Windows Phone development and Google Dart. In his off hours, Chad enjoys relaxing at his home and spending time with his wife, Heather, and son, Leo.
About the Reviewers Aniket Maithani is a budding engineer and is currently pursuing a B.Tech in Computer Science and Engineering from Amity University. He is primarily interested in contributing to open source projects and believes in the FOSS/FLOSS ideology. He has been working in the field of embedded systems and open hardware for the last two years. Apart from coding and hacking around with regular stuff, he loves to play the guitar and write on his blog. He can be reached at me@aniketmaithani.net. There are a few people I would like to thank for helping me out. Firstly, my dad, who introduced me to the world of computers! Also, I would like to thank my professor Mr. Manoj Baliyan and my senior Mr. Anuvrat Parashar, who introduced me to the world of Python and its awesomeness. I would also like to thank my mentor, Satyakaam Goswami for always guiding me. Lastly, God Almighty for his kind grace and blessings. Atmaram Shetye is a Computer Science and Engineering Graduate from Goa University. Having worked in a variety of companies, from start-ups to large multinational enterprises, he is a strong supporter of polyglot programming. He has spent most of his time programming in Python, while also using C, Objective-C, C++, and JavaScript at work. His areas of interest include artificial intelligence and machine learning. He is currently working as a Principal Software Engineer at CA Technologies, Bangalore.
Giuseppe Vettigli is a data scientist who has worked in the research industry and academia for many years. His work is focused on the development of machine learning models and applications to utilize information from structured and unstructured data. He also writes about scientific computing and data visualization in Python on his blog at http://glowingpython.blogspot.com. Ron Zacharski completed a PhD in Computer Science at the University of Minnesota, focusing on artificial intelligence and computational linguistics. He is the author of the free online Python-based book, A Programmer's Guide to Data Mining: The Ancient Art of the Numerati (http://www.guidetodatamining.com). He is an Associate Professor of Computer Science at the University of Mary Washington. Ron is a novice Zen Buddhist monk.
www.PacktPub.com Support files, eBooks, discount offers, and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub. com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. TM http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why subscribe? • Fully searchable across every book published by Packt • Copy and paste, print and bookmark content • On demand and accessible via web browser Free access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
分享到:
收藏