Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
NumPy Beginner's Guide
NumPy Beginner's Guide

NumPy Beginner's Guide: An action packed guide using real world examples of the easy to use, high performance, free open source NumPy mathematical library. , Second Edition

eBook
€8.99 €28.99
Paperback
€37.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

NumPy Beginner's Guide

Chapter 2. Beginning with NumPy Fundamentals

After installing NumPy and getting some code to work, it's time to cover NumPy basics.

The topics we shall cover in this chapter are:

  • Data types

  • Array types

  • Type conversions

  • Array creation

  • Indexing

  • Slicing

  • Shape manipulation

Before we start, let me make a few remarks about the code examples in this chapter. The code snippets in this chapter show input and output from several IPython sessions. Recall that IPython was introduced in Chapter 1, NumPy Quick Start, as the interactive Python shell of choice for scientific computing. The advantages of IPython are the PyLab switch that imports many scientific computing Python packages, including NumPy, and the fact that it is not necessary to explicitly call the print function to display variable values. However, the source code delivered alongside the book is regular Python code that uses imports and print statements.

NumPy array object


NumPy has a multi-dimensional array object called ndarray . It consists of two parts:

  • The actual data

  • Some metadata describing the data

The majority of array operations leave the raw data untouched. The only aspect that changes is the metadata.

We have already learned, in the previous chapter, how to create an array using the arange function. Actually, we created a one-dimensional array that contained a set of numbers. ndarray can have more than one dimension.

The NumPy array is in general homogeneous (there is a special array type that is heterogeneous)—the items in the array have to be of the same type. The advantage is that, if we know that the items in the array are of the same type, it is easy to determine the storage size required for the array.

NumPy arrays are indexed just like in Python, starting from 0. Data types are represented by special objects. These objects will be discussed comprehensively in this chapter.

We will create an array with the arange function again...

Time for action – creating a multidimensional array


Now that we know how to create a vector, we are ready to create a multidimensional NumPy array. After we create the matrix, we would again want to display its shape.

  1. Create a multidimensional array.

  2. Show the array shape:

    In: m = array([arange(2), arange(2)])
    In: m
    Out:
    array([[0, 1],
           [0, 1]])
    In: m.shape
    Out: (2, 2)

What just happened?

We created a two-by-two array with the arange function we have come to trust and love. Without any warning, the array function appeared on the stage.

The array function creates an array from an object that you give to it. The object needs to be array-like, for instance, a Python list. In the preceding example, we passed in a list of arrays. The object is the only required argument of the array function. NumPy functions tend to have a lot of optional arguments with predefined defaults.

Pop quiz – the shape of ndarray

Q1. How is the shape of an ndarray stored?

  1. It is stored in a comma-separated string.

  2. It is...

Time for action – creating a record data type


The record data type is a heterogeneous data type—think of it as representing a row in a spreadsheet or a database. To give an example of a record data type, we will create a record for a shop inventory. The record contains the name of the item, a 40-character string, the number of items in the store represented by a 32-bit integer and, finally, a price represented by a 32-bit float. The following steps show how to create a record data type:

  1. Create the record:

    In: t = dtype([('name', str_, 40), ('numitems', int32), ('price', float32)])
    In: t
    Out: dtype([('name', '|S40'), ('numitems', '<i4'), ('price','<f4')])
  2. View the type (we can view the type of a field as well):

    In: t['name']
    Out: dtype('|S40')

If you don't give the array function a data type, it will assume that it is dealing with floating point numbers. To create the array now, we really have to specify the data type; otherwise, we will get a TypeError:

In: itemz = array([('Meaning of...

One-dimensional slicing and indexing


Slicing of one-dimensional NumPy arrays works just like slicing of Python lists. We can select a piece of an array from index 3 to 7 that extracts the elements 3 through 6:

In: a = arange(9)
In: a[3:7]
Out: array([3, 4, 5, 6])

We can select elements from index 0 to 7 with a step of 2:

In: a[:7:2]
Out: array([0, 2, 4, 6])

Similarly as in Python, we can use negative indices and reverse the array:

In: a[::-1]
Out: array([8, 7, 6, 5, 4, 3, 2, 1, 0])

Time for action – slicing and indexing multidimensional arrays


A ndarray supports slicing over multiple dimensions. For convenience, we refer to many dimensions at once, with an ellipsis.

  1. To illustrate, we will create an array with the arange function and reshape it:

    In: b = arange(24).reshape(2,3,4)
    In: b.shape
    Out: (2, 3, 4)
    In: b
    Out:
    array([[[ 0,  1,  2,  3],
            [ 4,  5,  6,  7],
            [ 8,  9, 10, 11]],
           [[12, 13, 14, 15],
            [16, 17, 18, 19],
            [20, 21, 22, 23]]])

    The array b has 24 elements with values 0 to 23 and we reshaped it to be a two-by-three-by-four, three-dimensional array. We can visualize this as a two-story building with 12 rooms on each floor, three rows and four columns (alternatively, you can think of it as a spreadsheet with sheets, rows, and columns). As you have probably guessed, the reshape function changes the shape of an array. You give it a tuple of integers, corresponding to the new shape. If the dimensions are not compatible with the data...

Time for action – manipulating array shapes


We already learned about the reshape function. Another recurring task is flattening of arrays.

  1. Ravel: We can accomplish this with the ravel function:

    In: b
    Out:
    array([[[ 0,  1,  2,  3],
            [ 4,  5,  6,  7],
            [ 8,  9, 10, 11]],
           [[12, 13, 14, 15],
            [16, 17, 18, 19],
            [20, 21, 22, 23]]])
    In: b.ravel()
    Out:
    array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13,14, 15, 16,
           17, 18, 19, 20, 21, 22, 23])
  2. Flatten: The appropriately-named function, flatten , does the same as ravel, but flatten always allocates new memory whereas ravel might return a view of the array.

    In: b.flatten()
    Out:
    array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13,14, 15, 16,
           17, 18, 19, 20, 21, 22, 23])
  3. Setting the shape with a tuple: Besides the reshape function, we can also set the shape directly with a tuple, which is shown as follows:

    In: b.shape = (6,4)
    In: b
    Out:
    array([[ 0,  1,  2,  3],
           [ 4,  5,  6,  7...

Time for action – stacking arrays


First, let's set up some arrays:

In: a = arange(9).reshape(3,3)
In: a
Out:
array([[0, 1, 2],
       [3, 4, 5],
       [6, 7, 8]])
In: b = 2 * a
In: b
Out:
array([[ 0,  2,  4],
       [ 6,  8, 10],
       [12, 14, 16]])
  1. Horizontal stacking: Starting with horizontal stacking, we will form a tuple of ndarrays and give it to the hstack function. This is shown as follows:

    In: hstack((a, b))
    Out:
    array([[ 0,  1,  2,  0,  2,  4],
           [ 3,  4,  5,  6,  8, 10],
           [ 6,  7,  8, 12, 14, 16]])

    We can achieve the same with the concatenate function, which is shown as follows:

    In: concatenate((a, b), axis=1)
    Out:
    array([[ 0,  1,  2,  0,  2,  4],
           [ 3,  4,  5,  6,  8, 10],
           [ 6,  7,  8, 12, 14, 16]])
  2. Vertical stacking: With vertical stacking, again, a tuple is formed. This time, it is given to the vstack function. This can be seen as follows:

    In: vstack((a, b))
    Out:
    array([[ 0,  1,  2],
           [ 3,  4,  5],
           [ 6,  7,  8],
           [ 0,  2,  4],
          ...

Time for action – splitting arrays


  1. Horizontal splitting: The ensuing code splits an array along its horizontal axis into three pieces of the same size and shape:

    In: a
    Out:
    array([[0, 1, 2],
           [3, 4, 5],
           [6, 7, 8]])
    In: hsplit(a, 3)
    Out:
    [array([[0],
           [3],
           [6]]),
     array([[1],
           [4],
           [7]]),
     array([[2],
           [5],
           [8]])]

    Compare it with a call of the split function, with extra parameter axis=1:

    In: split(a, 3, axis=1)
    Out:
    [array([[0],
           [3],
           [6]]),
     array([[1],
           [4],
           [7]]),
     array([[2],
           [5],
           [8]])]
  2. Vertical splitting: The vsplit function splits along the vertical axis:

    In: vsplit(a, 3)
    Out: [array([[0, 1, 2]]), array([[3, 4, 5]]), array([[6, 7,8]])]

    The split function, with axis=0, also splits along the vertical axis:

    In: split(a, 3, axis=0)
    Out: [array([[0, 1, 2]]), array([[3, 4, 5]]), array([[6, 7,8]])]
  3. Depth-wise splitting: The dsplit function, unsurprisingly, splits depth-wise. We will need an array of rank...

Time for action – converting arrays


We can convert a NumPy array to a Python list with the tolist function:

  1. Convert to a list:

    In: b
    Out: array([ 1.+1.j,  3.+2.j])
    In: b.tolist()
    Out: [(1+1j), (3+2j)]
  2. The astype function converts the array to an array of the specified type:

    In: b
    Out: array([ 1.+1.j,  3.+2.j])
    In: b.astype(int)
    /usr/local/bin/ipython:1: ComplexWarning: Casting complex values to real discards the imaginary part
      #!/usr/bin/python
    Out: array([1, 3])

    Note

    We are losing the imaginary part when casting from complex type to int. The astype function also accepts the name of a type as a string.

    In: b.astype('complex')

    Out: array([ 1.+1.j, 3.+2.j])

    It won't show any warning this time, because we used the proper data type.

What just happened?

We converted NumPy arrays to a list and to arrays of different data types.

Summary


We learned a lot in this chapter about the NumPy fundamentals: data types and arrays. Arrays have several attributes describing them. We learned that one of these attributes is the data type, which in NumPy, is represented by a full-fledged object.

NumPy arrays can be sliced and indexed in an efficient manner, just like Python lists. NumPy arrays have the added ability of working with multiple dimensions.

The shape of an array can be manipulated in many ways—stacking, resizing, reshaping, and splitting. A great number of convenience functions for shape manipulation were demonstrated in this chapter.

Having learned about the basics, it's time to move on to the study of commonly-used functions in Chapter 3, Get to Terms with Commonly Used Functions. This includes basic statistical and mathematical functions.

Left arrow icon Right arrow icon

Key benefits

  • Perform high performance calculations with clean and efficient NumPy code.
  • Analyze large data sets with statistical functions
  • Execute complex linear algebra and mathematical computations

Description

NumPy is an extension to, and the fundamental package for scientific computing with Python. In today's world of science and technology, it is all about speed and flexibility. When it comes to scientific computing, NumPy is on the top of the list. NumPy Beginner's Guide will teach you about NumPy, a leading scientific computing library. NumPy replaces a lot of the functionality of Matlab and Mathematica, but in contrast to those products, is free and open source. Write readable, efficient, and fast code, which is as close to the language of mathematics as is currently possible with the cutting edge open source NumPy software library. Learn all the ins and outs of NumPy that requires you to know basic Python only. Save thousands of dollars on expensive software, while keeping all the flexibility and power of your favourite programming language.You will learn about installing and using NumPy and related concepts. At the end of the book we will explore some related scientific computing projects. This book will give you a solid foundation in NumPy arrays and universal functions. Through examples, you will also learn about plotting with Matplotlib and the related SciPy project. NumPy Beginner's Guide will help you be productive with NumPy and have you writing clean and fast code in no time at all.

Who is this book for?

If you are a programmer, scientist, or engineer who has basic Python knowledge and would like to be able to do numerical computations with Python, this book is for you. No prior knowledge of NumPy is required.

What you will learn

  • Install NumPy
  • NumPy arrays
  • Universal functions
  • NumPy matrices
  • NumPy modules
  • Plot with Matplotlib
  • Test NumPy code
  • Relation to SciPy
Estimated delivery fee Deliver to Malta

Premium delivery 7 - 10 business days

€32.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 25, 2013
Length: 310 pages
Edition : 2nd
Language : English
ISBN-13 : 9781782166085
Category :
Languages :
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Malta

Premium delivery 7 - 10 business days

€32.95
(Includes tracking information)

Product Details

Publication date : Apr 25, 2013
Length: 310 pages
Edition : 2nd
Language : English
ISBN-13 : 9781782166085
Category :
Languages :
Concepts :
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 117.97
NumPy Cookbook
€37.99
Building Machine Learning Systems with Python
€41.99
NumPy Beginner's Guide
€37.99
Total 117.97 Stars icon
Banner background image

Table of Contents

11 Chapters
NumPy Quick Start Chevron down icon Chevron up icon
Beginning with NumPy Fundamentals Chevron down icon Chevron up icon
Get in Terms with Commonly Used Functions Chevron down icon Chevron up icon
Convenience Functions for Your Convenience Chevron down icon Chevron up icon
Working with Matrices and ufuncs Chevron down icon Chevron up icon
Move Further with NumPy Modules Chevron down icon Chevron up icon
Peeking into Special Routines Chevron down icon Chevron up icon
Assure Quality with Testing Chevron down icon Chevron up icon
Plotting with Matplotlib Chevron down icon Chevron up icon
When NumPy is Not Enough – SciPy and Beyond Chevron down icon Chevron up icon
Playing with Pygame Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.2
(14 Ratings)
5 star 35.7%
4 star 50%
3 star 14.3%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




nipun Jun 13, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I had written a review for this book on my blog here: http://nipunbatra.wordpress.com/2013/06/11/book-review-numpy-beginners-guide-second-edition/ I would recommend this book highly. It is very good for newcomers. For Python oldies it might be a little slow. NumPy Beginner's Guide - Second Edition
Amazon Verified review Amazon
Tamir Lousky Jun 15, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book is very well written, and tries (quite successfully) to address this specialized, complicated subject in a light, simplified manner without losing depth and oversimplifying. The book includes many down to earth examples and sample code, and many interesting exercises that help implement the material.It starts with a nice, gradual introduction to NumPy, its functions, data structures and uses (and of course, how to install it). Then, the book addresses how to handle, analyze and manipulate larger datasets with examples from stock market data. Around half way, the book focuses on matrices and linear systems. The last few subjects cover advanced topics which I didn't delve into yet.All in all, a very good book, fun to read and useful. Recommended to anyone interested in manipulating arrays, matrices and large datasets in python efficiently.For further information, please see the mini-review on my blog:http://bioblog3d.wordpress.com/2013/06/15/numpy-beginners-guide-review/
Amazon Verified review Amazon
ReaddyEddy Jul 03, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Who is it for:This is an excellent book for the Python programmer who wants to extend their knowledge into mathematical programming and those with a mathematical or engineering background who want to leverage open source alternatives to commercial tools by using the NumPy with Python.Installation and other packages:Installation on the main platforms and the relationship between NumPy and SciPy, and using the library with Matplotlib and other Python modules is well covered.What's covered:The coverage is goes from creating vectors and multi-dimensional matrices through calculating Eigenvectors, the FFT, complex numbers, polynomial fitting and many others.Example Code:The examples I've followed are well thought through and illustrate the use the relevant parts of the NumPy API required in a clear and concise manner. An increasing amount of mathematical background is needed and for a beginner the book should be read in conjunction with a text book covering the relevant material.Recommendation:I would heartily recommend the book both as tool for learning and as a working reference for the NumPy library and wish it had been available when I was going up the learning curve.
Amazon Verified review Amazon
Paul A. Courchene Jul 02, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I wish to comment on the excellent book by Ivan Idris. The text entitled NumPy Beginner's Guide, Second Edition is an outstanding book for a broad range of computer enthusiasts. While not all computer nerds are necessarily interested in Programming per se', in light of the growth and momentum of digital media, it is now a fact of life that many fields of employment require some basic introduction to computer programming. Whether you are a business or financial analyst, or perhaps a serious computer wanabee, or even a College student, it is now time to take the first step. With the momentum seen in the computer language of Python, many people who would otherwise not be inclined to learn this skill, never the less are posing some interest and saying "I wonder if I could do that?" This book will show you how. Since this book covers programming with Python from A to Z, and provides an easy path of self-learning, a number of people with a broad range of computer and math skills can accomplish these tasks.Yes, sitting in the classroom somewhere and listening to someone lecture on the fine points of computer programming may be the road to success for lots of people, but it is not beyond achieving this same goal of learning new skills by self-study ... In the first few pages of this book, the notion of interactive python is introduced (called IPython). That is, one would take a canned script or snippet of sample code and run it in a command line interpreter or interactive shell. That is a fancy name for entering code at a prompt, essentially using a cut and paste routine. How simple can it be ... Since the subject text has a bazillion examples or python routines and coding structure, one can view a broad range of examples from the simplistic to the quite advanced level. With this book, following along step by step or page by page, you can almost become a computer (read python) programmer, overnight. I. E., one enters the example code, then follows the book and reviews the resulting output, along with subtle hints about the interpreter operation. The shell (or debugger) will allow you to step into the code line by line and view the resultant computer operations. Thus, not only do you have visual feedback (to check your work) but one of the books highlights are the numerous "On-line resources and help" that will provide you with support material at a click of a mouse. As an aside, I regularly read the Yahoo email Group entitled "the Python Community"([...] each day where someone asks the basic question about "Where can I learn Python by way of self-study?" This book provides that answer and opportunity. So Chapter 1 of this book is appropriately entitled"NumPy Quick Start". As you begin Chapter 2, you will soon recognize the format that follows, and gives the reader (or student) an introduction to key Python topics. For example, to program a machine to organize and otherwise manipulate data, be it text or a set of integers, we need to know some basic objects such as data structures. So after a few words about a data structure like an "array", one needs to create an array using examples (code) from the book. With further comments about "What happened?", while creating an array, you will be provided a mini quiz or "Pop quiz" that will test your comprehension and understanding of the concept at hand. Obviously, the quiz is a good reinforcement tool to aid learning. Next, the author uses additional examples to lead you through some more variations of the objects that you are studying. That is: the "Time for Action" is now an opportunity to alter or create alternate arrays by manipulating their dimensions etc. This Time for Action is actually a number of requests (or examples) for "you to try it". Now, not only are you learning new skills and techniques but in fact are "gaining experience" with Python. As a computer wanabee, I now recommend that you take a pencil in hand and copy some of the examples on paper (that you may be interested in). This may be seen as a proactive learning experience and will help you understand some rudimentary things like the syntax (the ways words combine to form phrases or code) of the Python language.Let me clarify a point here, about this text. It is true that this text is focused on mathematical techniques that the average beginner may not be quite ready for, I. E. basic Statistics and Linear Models as seen in Chapter 3, but I would argue that as we discussed above, the layout of the book and its associated (read: excellent) format allows one to learn and gain experience, one step at a time. Chapter 4 of the book lays out additional functions that start to exhibit the power of NumPy. For example (page 95) starts a discussion of Polynomials, in layman's terms, that of finding a function the fits a set of data. I am of course assuming that you have some interest in math and "numbers" per se', if in fact you have searched for this book at Amazon.com Other Chapters go on to highlight such programming techniques as related to:(3). CSV files, Simple Statistics, Linear Models and Trend Lines, (4). Convenient Functions,(5). Matrices and Universal Functions, (6) Linear Algebra, Random Numbers, Distributions,(7). Special Routines for Sorting, Searching, Financial Functions. (8) Quality and Testing [of software],(9). Plotting (results such as Graphs, Histograms, Scatter Plots etc.),(10.) SciPy., a Python based system for Scientists, Engineering and Mathematics. and(11). PyGames. What could be more fun than learning to program games in Python. As you inspect this book, you will find something of interest to everyone who is acquainted with the word Python.It is an excellent book in a format that is easy to find a keyword or idea and will remain a valuable resource to you, for a long time.
Amazon Verified review Amazon
Roberto Avilés Jun 09, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I have been reviewing Ivan Idris Numpy `beginner's guide', second edition of a great book. While in the first edition he started explaining iPython and Matplotlib, this second is an even more practical guide: "less theory, more results". The first chapter deals with essentials as Python, iPython and libraries as NumPy, Matplotlib and Scipy and ends with applications to vectors and arrays using those tools. Just then in second chapter he goes deep into NumPy fundamentals with many exercises using arrays, including passing from an array to a list (exercise that helps to understand what are the differences and advantages of each data type.)Chapter 3 relates to common functions and applications to, example, finances and times. Chapter 4 deals with how to fit polynomials and also Smoothing and as an example, the Hanning function. Chapter 5 is related to matrices and "ufuncs" (short by universal functions) including how to create it and use with a code. These ideas are applied to a classic, Fibonacci numbers but also to Lissajous curves and the drawing of sawtooth and triangle waves, and also how to work with bitwise comparison operations. Up to this point this is the perfect companion for a crash course on the uses of Python and libraries like NumPy; however is also strong enough to be used as part of a college lecture or as the tool that should not be absent in your tool box and desk. Is hard to summarize further chapters; is a very good book because Idris shows his ability to explain in clear and concise sentences and then he applies immediately to exercises in a variety of areas. If you can't find what you need in this book, the only solution might be a do it yourself solution, based in the' big book', the web! In chapter 6 he explains applications to Linear Algebra including eigenvalues and eigenvectors, Fourier Transform, random numbers and applications to a gambling show. In chapter 7 he works with complex numbers, including sorting and searching, and even plays with Bessel functions. Chapter 8 deals on Assuring Quality with Testing and how to assert and compare arrays. Chapter 9 is one of my favorites, because Idris shows excellent examples on how to plot using Matplotlib, including animations! If you cannot impress your audience with these tools, likely they are dead. In Chapter 10 he goes deeper on libraries like Scipy (NumPy + SciPy are essentials on dealing with big arrays of data, like images) but this time Idris also give us hints in how to deal with audio processing. Finally in Chapter 11, he talks about PyGame along with Matplotlib, Numpy and applications to ... Artificial Intelligence, and simulations of life.Certainly one book can hardly cover ALL `what we need'. However, is up to us to get the most of a tool. If you work on Engineering or Science and are in need to deal with data, vectors, matrices, arrays, sounds or images, if you need to plot and to make things evident to others, if you need a data handling Swiss tool in your toolkit, this is it, clear, concise, full of many examples in so many areas that you will always have something to talk with others even from areas different to yours. Read it, use it, enjoy it.
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 the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela