没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Vaingast
Shelve in
Programming Languages/General
User level:
Beginning–Intermediate
www.apress.com
SOURCE CODE ONLINE
BOOKS FOR PROFESSIONALS BY PROFESSIONALS
®
Beginning Python Visualization:
Crafting Visual Transformation Scripts
We are visual animals. But before we can see the world in its true splendor, our brains,
just like our computers, have to sort and organize raw data, and then transform that
data to produce new images of the world. Beginning Python Visualization: Crafting Visual
Transformation Scripts, Second Edition discusses turning many types of data sources,
big and small, into useful visual data. And, you will learn Python as part of the bargain.
In this second edition you’ll learn about Spyder, which is a Python IDE with MATLAB
®
-like
features. Here and throughout the book, you’ll get detailed exposure to the growing
IPython project for interactive visualization. In addition, you’ll learn about the changes
in NumPy and SciPy that have occurred since the first edition. Along the way, you’ll get
many pointers and a few visual examples.
As part of this update, you’ll learn about matplotlib in detail; this includes creating
3D graphs and using the basemap package that allows you to render geographical
maps. Finally, you’ll learn about image processing, annotating, and filtering, as well as
how to make movies using Python. This includes learning how to edit/open video files
and how to create your own movie, all with Python scripts
Beginning Python Visualization teaches you:
• How to present visual information instead of data soup
• How to set up an open source environment ready for data visualization
• How to do numerical and textual processing
• How to draw graphs and plots based on textual and numerical data
using NumPy, Spyder, and more
• How to explore and use new visual libraries including matplotlib’s
3D graphs and basemap package
• How to build and use interactive visualization using IPython
SECOND
EDITION
RELATED
9781484 200537
54999
ISBN 978-1-4842-0053-7
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
v
Contents at a Glance
About the Author ��������������������������������������������������������������������������������������������������������������� xix
About the Technical Reviewer ������������������������������������������������������������������������������������������� xxi
Acknowledgments ����������������������������������������������������������������������������������������������������������� xxiii
Introduction ���������������������������������������������������������������������������������������������������������������������� xxv
Chapter 1: Navigating the World of Data Visualization ■ ������������������������������������������������������1
Chapter 2: The Environment ■ ��������������������������������������������������������������������������������������������31
Chapter 3: Python for Programmers ■ �������������������������������������������������������������������������������55
Chapter 4: Data Organization ■ ���������������������������������������������������������������������������������������109
Chapter 5: Processing Text Files ■ ����������������������������������������������������������������������������������141
Chapter 6: Graphs and Plots ■ ������������������������������������������������������������������������������������������189
Chapter 7: Math Games ■ �������������������������������������������������������������������������������������������������233
Chapter 8: Science and Visualization ■ ����������������������������������������������������������������������������269
Chapter 9: Image Processing ■ ����������������������������������������������������������������������������������������307
Chapter 10: Advanced File Processing ■ ��������������������������������������������������������������������������343
Appendix: Additional Source Listing ■ �����������������������������������������������������������������������������371
Index ���������������������������������������������������������������������������������������������������������������������������������379
xxv
Introduction
I have always been drawn to math and computers, ever since I was a kid playing computer games on my Sinclair ZX81.
When I attended university, I had a special interest in numerical analysis, a eld that I feel combines math and
computers ideally. During my career, I learned of MATLAB, widely popular for digital signal processing, numerical
analysis, and feedback and control. MATLAB’s strong suits include a high-level programming language, excellent
graphing capabilities, and numerous packages from almost every imaginable engineering eld. But I found that
MATLAB wasn’t enough. I worked with very large les and needed the ability to manipulate both text and data.
So I combined Perl, AWK, and Bash scripts to write programs that automate data analysis and visualization. And along
the way, I’ve developed practices and ideas involving the organization of data, such as ways to ensure le names are
unique and self-explanatory.
With the increasing popularity of the Internet, I learned about GNU/Linux and the open source movement.
I’ve made an eort to use open source software whenever possible, and so I’ve learned of GNU-Octave and gnuplot,
which together provide excellent scientic computing functionality. at t well on my Linux machine: Bash scripts,
Perl and AWK, GNU-Octave, and gnuplot.
Knowing I was interested in programming languages and open source software, a friend suggested I give Python
a try. My rst impression was that it was just another programming language: I could do almost anything I needed
with Perl and Bash, resorting to C/C++ if things got hairy. And I’d still need GNU-Octave and gnuplot, so what was
the advantage? Eventually, I did learn Python and discovered that it is far better than my previous collection of tools.
Python provides something that is extremely appealing: it’s a one-stop shop—you can do it all in Python.
I’ve shared my enthusiasm with friends and colleagues. Many who expressed interest with the ideas of data
processing and visualization would ask, “Can you recommend a book that teaches the ideas you’re preaching?”
And I would tell them, “Of course, numerous books cover this subject! But they didn’t want numerous books, just one,
with information distilled to focus on data analysis and visualization. I realized there wasn’t such a title, and this was
how the idea for this book originated.
What’s New in the Second Edition
Aside from using the most up-to-date version of Python that supports all the visualization packages (version 3.3 at the
time of the writing the second edition), I’ve also introduced the following additional content:
3-D plots and graphs•
Non-rectangular contour plots•
Matplotlib’s basemap• toolkit
Reading and writing MATLAB binary les•
Reading and writing data to • NumPy arrays
Reading and writing images to • NumPy arrays
Making movies•
IPython, IPython Notebook, and Spyder development environments•
■ IntroduCtIon
xxvi
Who This Book Is For
Although this book is about software, the target audience is not necessarily programmers or computer scientists.
I’ve assumed the reader’s main line of work is research or R&D, in his or her eld of interest, be it astrophysics, signal
and image processing, or biology. e audience includes the following:
Graduate and PhD students in exact and natural sciences (physics, biology, and chemistry) •
working on their thesis, dealing with large experimental data sets. e book also appeals to
students working on purely theoretical projects, as they require simulations and means to
analyze the results.
R&D engineers in the elds of electrical engineering (EE), mechanical engineering, and •
chemical engineering: engineers working with large sets of data from multiple sources.
In EE more specically, signal processing engineers, communication engineers, and systems
engineers will nd the book appealing.
Programmers and computer enthusiasts, unfamiliar with Python and the GNU/Linux world, •
but who are willing to dive into a new world of tools.
Hobbyist astronomers and other hobbyists who deal with data and are interested in using •
Python to support their hobby.
e book can be appealing to these groups for dierent reasons. For scientists and engineers, the book provides
the means to be more productive in their work, without investing a considerable amount of time learning new
tools and programs that constantly change. For programmers and computer enthusiasts, the book can serve as an
appetizer, opening up their world to Python. And because of the unique approach presented here, they might share
the enthusiasm the author has for this wonderful software world. Perhaps it will even entice them to be part of the
large and growing open source community, sharing their own code.
It is assumed that the reader does have minimal prociency with a computer, namely that he or she must
know how to manipulate les, install applications, view and edit les, and use applications to generate reports and
presentations. A background in numerical analysis, signal processing, and image processing, as well as programming,
is also helpful, but not required.
is book is not intended to serve as an encyclopedia of programming in Python and the covered packages.
Rather, it is meant to serve as an introduction to data analysis and visualization in Python, and it covers most of the
topics associated with that eld.
How This Book Is Structured
e book is designed so that you can easily skip back and forth as you engage various topics.
Chapter 1 is a case study that introduces the topics discussed throughout the book: data analysis, data
management, and, of course, data visualization. e case study involves reading GPS data, analyzing it, and plotting it
along with relevant annotations (direction of travel, speed, etc.). A fully functional Python script will be built from the
ground up, complemented with lots of explanations. e fruit of our work will be an eye-catching GPS route.
If you’re new to data analysis and visualization, consider reading Chapter 2 rst. e chapter describes how to
set up a development environment to perform the tasks associated with data analysis and visualization in Python,
including the selection of an OS, installing Python, and installing third-party packages.
If you’re new to Python, your next stop should be Chapter 3. In this chapter, I swiftly discuss the Python
programming language. I won’t be overly rehashing basic programming paradigms; instead I’ll provide a quick
overview of the building blocks for the Python programming.
Regardless of your Python programming experience, I highly encourage you to read Chapter 4 before
proceeding to the next chapters. Organization is the key to successful data analysis and visualization. is chapter
covers organizing data les, pros and cons of dierent le formats, le naming conventions, nding data les, and
automating le creation. e ideas in Chapter 4 are used throughout the book.
剩余404页未读,继续阅读
资源评论
yinkaisheng-nj
- 粉丝: 762
- 资源: 6231
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功