Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Matplotlib

You're reading from   Mastering Matplotlib A practical guide that takes you beyond the basics of matplotlib and gives solutions to plot complex data

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781783987542
Length 292 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Preface 1. Getting Up to Speed 2. The matplotlib Architecture FREE CHAPTER 3. matplotlib APIs and Integrations 4. Event Handling and Interactive Plots 5. High-level Plotting and Data Analysis 6. Customization and Configuration 7. Deploying matplotlib in Cloud Environments 8. matplotlib and Big Data 9. Clustering for matplotlib Index

Python 3

On this note, it's probably good to discuss Python 3 briefly as there has been continued debate on the choice between the two most recent versions of the programming language (the other being the 2.7.x series). Python 3 represents a massive community-wide effort to adopt better coding practices as well as improvements in the maintenance of long-lived libraries, frameworks, and applications. The primary impetus and on-going strength of this effort, though, is a general overhaul of the mechanisms underlying Python itself. This will ultimately allow the Python programming language greater maintainability and longevity in the coming years, not to mention better support for the ongoing performance enhancements.

In case you are new to Python 3, the following table, which compares some of the major syntactical differences between Python 2 and Python 3, has been provided:

Syntactical Differences

Python 2

Python 3

Division with floats

x = 15 / 3.0

x = 15 / 3

Division with truncation

x = 15 / 4

x = 15 // 4

Longs

y = long(x * 10)

y = int(x * 10)

Not equal

x <> y

x != y

The unicode function

u = unicode(s)

u = str(s)

Raw unicode

u = ur"\t\s"

u = r"\t\s"

Printing

print x, y, z

print(x, y, z)

Raw user input

y = raw_input(x)

y = input(x)

User input

y = input(x)

y = eval(input(x))

Formatting

"%d %s" % (n, s)

"{} {}".format(n,s)

Representation

'x'

repr(x)

Function application

apply(fn, args)

fn(*args)

Filter

itertools.ifilter

filter

Map

itertools.imap

map

Zip

itertools.izip

zip

Range

xrange

range

Reduce

reduce

functools.reduce

Iteration

iterator.next()

next(iterator)

The execute code

exec code

exec(code)

The execute file

execfile(file)

exec(fh.read())

Exceptions

try:

...

except val, err:

...

try:

...

except val as err:

...

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 AU $24.99/month. Cancel anytime