NumPy 1.5 Beginner's Guide

There is a newer version of this book available - NumPy Beginner’s Guide - Second Edition
eBook: \$26.99
Formats:
\$22.94
save 15%!
Print + free eBook + free PacktLib access to the book: \$71.98    Print cover: \$44.99
\$44.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
 Also available on: Select a store Amazon.com Amazon UK Barnes & Noble Safari Books Online
Overview
Author
Reviews
Support
Sample Chapters
• The first and only book that truly explores NumPy practically
• Perform high performance calculations with clean and efficient NumPy code
• Analyze large data sets with statistical functions
• Execute complex linear algebra and mathematical computations

Book Details

Language : English
Paperback : 234 pages [ 235mm x 191mm ]
Release Date : November 2011
ISBN : 1849515301
ISBN 13 : 9781849515306
Author(s) : Ivan Idris
Topics and Technologies : All Books, Data, Beginner's Guides, Open Source, Python

Preface
Chapter 1: NumPy Quick Start
Chapter 2: Beginning with NumPy Fundamentals
Chapter 3: Get into Terms with Commonly Used Functions
Chapter 4: Convenience Functions for Your Convenience
Chapter 5: Working with Matrices and ufuncs
Chapter 6: Move Further with NumPy Modules
Chapter 7: Peeking Into Special Routines
Chapter 8: Assure Quality with Testing
Chapter 9: Plotting with Matplotlib
Chapter 10: When NumPy is Not Enough: SciPy and Beyond
Index
• Chapter 1: NumPy Quick Start
• Python
• Time for action – installing Python on different operating systems
• Windows
• Time for action – installing NumPy on Windows
• Linux
• Time for action – installing NumPy on Linux
• Mac OS X
• Time for action – installing NumPy on Mac OS X with a GUI installer
• Time for action – installing NumPy with MacPorts or Fink
• Building from source
• Vectors
• Time for action – adding vectors
• IPython—an interactive shell
• Online resources and help
• Summary
• Chapter 2: Beginning with NumPy Fundamentals
• NumPy array object
• Time for action – creating a multidimensional array
• Selecting elements
• NumPy numerical types
• Data type objects
• Character codes
• dtype constructors
• dtype attributes
• Time for action – creating a record data type
• One-dimensional slicing and indexing
• Time for action – slicing and indexing multidimensional arrays
• Time for action – manipulating array shapes
• Stacking
• Time for action – stacking arrays
• Splitting
• Time for action – splitting arrays
• Array attributes
• Time for action – converting arrays
• Summary
• Chapter 3: Get into Terms with Commonly Used Functions
• File I/O
• Time for action – reading and writing files
• Identity matrix creation
• CSV files
• Volume weighted average price
• Time for action – calculating volume weighted average price
• The mean function
• Time weighted average price
• Value range
• Time for action – finding highest and lowest values
• Statistics
• Time for action – doing simple statistics
• Stock returns
• Time for action – analyzing stock returns
• Dates
• Time for action – dealing with dates
• Weekly summary
• Time for action – summarizing data
• Average true range
• Time for action – calculating the average true range
• Simple moving average
• Time for action – computing the simple moving average
• Exponential moving average
• Time for action – calculating the exponential moving average
• Bollinger bands
• Time for action – enveloping with Bollinger bands
• Linear model
• Time for action – predicting price with a linear model
• Trend lines
• Time for action – drawing trend lines
• Methods of ndarray
• Time for action – clipping and compressing arrays
• Factorial
• Time for action – calculating the factorial
• Summary
• Chapter 4: Convenience Functions for Your Convenience
• Correlation
• Time for action – trading correlated pairs
• Polynomials
• Time for action – fitting to polynomials
• On-balance volume
• Time for action – balancing volume
• The mode
• Time for action – determining the mode of stock returns
• Simulation
• Time for action – avoiding loops with vectorize
• Smoothing
• Time for action – smoothing with the hanning function
• Summary
• Chapter 5: Working with Matrices and ufuncs
• Matrices
• Time for action – creating matrices
• Creating a matrix from other matrices
• Time for action – creating a matrix from other matrices
• Universal functions
• Time for action – creating universal function
• Universal function methods
• Time for action – applying the ufunc methods on add
• Arithmetic functions
• Time for action – dividing arrays
• Modulo operation
• Time for action – computing the modulo
• Fibonacci numbers
• Time for action – computing Fibonacci numbers
• Lissajous curves
• Time for action – drawing Lissajous curves
• Square waves
• Time for action – drawing a square wave
• Sawtooth and triangle waves
• Time for action – drawing sawtooth and triangle waves
• Bitwise and comparison functions
• Time for action – twiddling bits
• Summary
• Chapter 6: Move Further with NumPy Modules
• Linear algebra
• Time for action – inverting matrices
• Solving linear systems
• Time for action – solving a linear system
• Finding eigenvalues and eigenvectors
• Time for action – determining eigenvalues and eigenvectors
• Singular value decomposition
• Time for action – decomposing a matrix
• Pseudo inverse
• Time for action – computing the pseudo inverse of a matrix
• Determinants
• Time for action – calculating the determinant of a matrix
• Fast Fourier transform
• Time for action – calculating the Fourier transform
• Shifting
• Time for action – shifting frequencies
• Random numbers
• Time for action – gambling with the binomial
• Hypergeometric distribution
• Time for action – simulating a game show
• Continuous distributions
• Time for action – drawing a normal distribution
• Lognormal distribution
• Time for action – drawing the lognormal distribution
• Summary
• Chapter 7: Peeking Into Special Routines
• Sorting
• Time for action – sorting lexically
• Complex numbers
• Time for action – sorting complex numbers
• Searching
• Time for action – using searchsorted
• Array elements extraction
• Time for action – extracting elements from an array
• Financial functions
• Time for action – determining future value
• Present value
• Time for action – getting the present value
• Net present value
• Time for action – calculating the net present value
• Internal rate of return
• Time for action – determining the internal rate of return
• Periodic payments
• Time for action – calculating the periodic payments
• Number of payments
• Time for action – determining the number of periodic payments
• Interest rate
• Time for action – figuring out the rate
• Window functions
• Time for action – plotting the Bartlett window
• Blackman window
• Time for action – smoothing stock prices with the Blackman window
• Hamming window
• Time for action – plotting the Hamming window
• Kaiser window
• Time for action – plotting the Kaiser window
• Special mathematical functions
• Time for action – plotting the modified Bessel function
• Sinc
• Time for action - plotting the sinc function
• Summary
• Chapter 8: Assure Quality with Testing
• Assert functions
• Time for action – asserting almost equal
• Approximately equal arrays
• Time for action – asserting approximately equal
• Almost equal arrays
• Time for action – asserting arrays almost equal
• Equal arrays
• Time for action – comparing arrays
• Ordering arrays
• Time for action – checking the array order
• Objects comparison
• Time for action – comparing objects
• String comparison
• Time for action – comparing strings
• Floating point comparisons
• Time for action – comparing with assert_array_almost_equal_nulp
• Comparison of floats with more ULPs
• Time for action – comparing using maxulp of 2
• Summary
• Chapter 9: Plotting with Matplotlib
• Simple plots
• Time for action – plotting a polynomial function
• Plot format string
• Time for action – plotting a polynomial and its derivative
• Subplots
• Time for action – plotting a polynomial and its derivatives
• Finance
• Time for action – plotting a year's worth of stock quotes
• Histograms
• Time for action – charting stock price distributions
• Logarithmic plots
• Time for action – plotting stock volume
• Scatter plots
• Time for action – plotting price and volume returns with scatter plot
• Fill between
• Time for action – shading plot regions based on a condition
• Legend and annotations
• Time for action – using legend and annotations
• Summary
• Chapter 10: When NumPy is Not Enough: SciPy and Beyond
• Matlab and Octave
• Statistics
• Time for action – analyzing random values
• Samples comparison and SciKits
• Time for action – comparing stock log returns
• Signal processing
• Time for action – detecting a trend in QQQ
• Fourier analysis
• Time for action – filtering a detrended signal
• Optimization
• Time for action – fitting to a sine
• Numerical integration
• Time for action – calculating the Gaussian integral
• Interpolation
• Time for action – interpolating in one dimension
• Image processing
• Time for action – manipulating Lena
• Summary
• Chapter 1, NumPy Quick Start
• Chapter 2, Beginning with NumPy Fundamentals
• Chapter 3, Get into Terms with Commonly Used Functions
• Chapter 4, Convenience Functions for Your Convenience
• Chapter 5, Working with Matrices and ufuncs
• Chapter 6, Move Further with NumPy Modules
• Chapter 7, Peeking into Special Routines
• Chapter 8, Assured Quality with Testing
• Chapter 9, Plotting with Matplotlib
• Chapter 10, When NumPy is not enough SciPy and Beyond

Ivan Idris

Ivan Idris has an MSc in Experimental Physics. His graduation thesis had a strong emphasis on Applied Computer Science. After graduating, he worked for several companies as a Java Developer, Data warehouse Developer, and QA Analyst. His main professional interests are Business Intelligence, Big Data, and Cloud Computing. Ivan Idris enjoys writing clean, testable code and interesting technical articles. Ivan Idris is the author of NumPy 1.5 Beginner's Guide and NumPy Cookbook by Packt Publishing. You can find more information and a blog with a few NumPy examples at ivanidris.net.

Sorry, we don't have any reviews for this title yet.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

Errata

- 1 submitted: last submission 26 Apr 2013

Errata type: Graphics | Page number: 39 | Errata date: 06/01/2012

The vertical stacking figure shows A alongside B rather than A above B.

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

+    =
50% Off
the eBooks

Buy both these recommended eBooks together and get 50% off the total price

What you will learn from this book

• Installing NumPy
• Learn to load arrays from files and write arrays to files
• Work with universal functions
• Create NumPy matrices
• Use basic modules that NumPy offers
• Write unit tests for NumPy code
• Plot mathematical NumPy results with Matplotlib
• Integrate with Scipy, a high level Python scientific computing framework built on top of NumPy

In Detail

In today's world of science and technology, the hype is all about speed and flexibility. When it comes to scientific computing, NumPy is on the top of the list. NumPy is the fundamental package needed for scientific computing with Python. NumPy will give you both speed and high productivity. Save thousands of dollars on expensive software, while keeping all the flexibility and power of your favourite programming language.

NumPy 1.5 Beginner's Guide will teach you about NumPy from scratch. It includes everything from installation, functions, matrices, and modules to testing, all explained with appropriate examples.

Numpy 1.5 Beginner's Guide will teach you about installing and using NumPy and related concepts.

This book will give you a solid foundation in NumPy arrays and universal functions. At the end of the book, we will explore related scientific computing projects such as Matplotlib for plotting and the SciPy project through examples.

NumPy 1.5 Beginner's Guide will help you be productive with NumPy and write clean and fast code.

Approach

The book is written in beginner’s guide style with each aspect of NumPy demonstrated by real world examples. There is appropriate explained code with the required screenshots thrown in for the novice.

Who this book is for

This book is for the programmer, scientist or engineer, who has basic Python knowledge and would like to be able to do numerical computations with Python.