Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
NumPy Cookbook

You're reading from  NumPy Cookbook

Product type Book
Published in Oct 2012
Publisher Packt
ISBN-13 9781849518925
Pages 226 pages
Edition 1st Edition
Languages

Table of Contents (17) Chapters

NumPy Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Winding Along with IPython 2. Advanced Indexing and Array Concepts 3. Get to Grips with Commonly Used Functions 4. Connecting NumPy with the Rest of the World 5. Audio and Image Processing 6. Special Arrays and Universal Functions 7. Profiling and Debugging 8. Quality Assurance 9. Speed Up Code with Cython 10. Fun with Scikits Index

Index

A

  • AAPL (Apple Inc.) / How to do it...
  • AffinityPropagation class / How to do it...
  • Anderson-Darling test
    • URL / Performing a normality test with scikits-statsmodels
  • append function / How it works...
  • Apple Developer Tools (Xcode)
    • installing / How to do it...
  • arange function / How to do it..., Summing Fibonacci numbers, How to do it..., How it works...
  • array interface
    • using / Using the array interface, How to do it..., How it works...
  • asarray function / How to do it...
  • assert_almost_equal function / How it works...
  • assert_approx_equal function / How it works...
  • assert_array_almost_equal function / How it works...
  • assert_array_equal function / How it works...
  • assert_array_less function / How it works...
  • assert_raises function / How it works...
  • assert_string_equal function / How it works...
  • assert_warns function / How it works...
  • astype function / Summing Fibonacci numbers, How to do it..., How it works...
  • audio filter
    • designing / Designing an audio filter, How to do it...
  • audio fragments
    • repeating / Repeating audio fragments, How to do it..., How it works...
  • axis function / How it works...

B

  • BDD
    • about / Introduction
    • way, used for testing / Testing the BDD way, How to do it…, How it works...
    • used, for testing / How to do it…
    • tests, setting up / How to do it…
    • steps, defining / How to do it…
  • binomial proportion confidence
    • wikipedia, URL / Using Cython with NumPy
  • boolean indexing
    • about / Indexing with booleans, How to do it..., How it works...
  • broadcasting arrays
    • about / Broadcasting arrays, How to do it...
  • Browse button / How to do it...
  • bt command / How to do it...
  • buffer interface
    • about / Using the buffer protocol
  • buffer protocol
    • about / Using the buffer protocol, How to do it..., How it works...
  • Butterworth bandpass filter
    • wikipedia, URL / How to do it...

C

  • Canny filter function / How to do it...
  • cdef keyword / How it works...
  • ceil function / How to do it..., How it works...
  • C functions
    • calling / Calling C functions, How to do it..., How it works...
    • .pyx file, writing / How to do it...
    • log returns, plotting / How to do it...
  • chararray object
    • about / Performing string operations with chararray
    • string operations. performing / Performing string operations with chararray, How it works...
  • Choose function / How it works...
  • cimport / How it works...
  • clip function / How it works...
  • clustering
    • about / Clustering Dow Jones stocks with scikits-learn
  • code
    • profiling, with cProfile extension / Profiling code with the cProfile extension, How to do it...
    • testing, docstrings used / Testing code with docstrings, How to do it..., How it works...
    • testing, mocks used / Testing code with mocks, How to do it...
  • Command Line Interface (CLI) / How to do it...
  • compress function / How to do it...
  • concatenate function / How it works...
  • corner detection
    • wikipedia, URL / Detecting corners
    • about / Detecting corners, How to do it...
  • cProfile extension
    • code, profiling with / Profiling code with the cProfile extension, How to do it...
  • create a new environment button / How to do it...
  • cumprod function / How to do it...
  • cumtime column / How it works...
  • Cython
    • about / Introduction
    • installing / Installing Cython
    • installing, ways for / How to do it...
    • installing, from tarball / How to do it...
    • installing, with setup tools / How to do it...
    • installing, with pip / How to do it...
    • installing, with Windows installers / How to do it...
    • using, with NumPy / Using Cython with NumPy, How to do it..., How it works...
    • factorials, approximating / Approximating factorials with Cython, How to do it..., How it works...
  • Cython approximation
    • of e / How to do it...
  • Cython code
    • profiling / Profiling Cython code, How to do it..., How it works...

D

  • daily log returns
    • wikipedia, URL / Trading periodically on dips
  • data
    • exchanging, with MATLAB / Exchanging data with MATLAB and Octave, How to do it...
    • exchanging, with Octave / Exchanging data with MATLAB and Octave, How to do it...
    • loading, as pandas objects, from statsmodels / Loading data as pandas objects from statsmodels, How to do it..., How it works...
  • DataFrame / How to do it...
  • DataFrame object / How to do it...
  • DataFrame plot method / How to do it...
  • Dataset class / How it works...
  • Dataset object / How to do it...
  • DatetimeIndex method / How to do it...
  • d command / How to do it...
  • Debian
    • PIL, installing / How to do it...
  • debugging
    • about / Introduction
  • diff function / How it works..., How to do it..., How it works...
  • dips
    • periodically, training on / Trading periodically on dips, How to do it..., How it works...
  • distutils setup.py script / How to do it...
  • docstrings
    • code, testing with / Testing code with docstrings, How to do it..., How it works...
  • dot function / How it works...
  • Dow Jones stocks
    • clustering, with scikits-learn project / Clustering Dow Jones stocks with scikits-learn, How to do it..., How it works...
  • do_work method / How to do it...

E

  • easy_install
    • IPython, installing with / How to do it...
    • used, for installing SciPy / How to do it...
    • used, for installing PIL / How to do it...
    • used, for installing RPy2 / How to do it...
    • used, for installing Pyflakes / How to do it...
    • used, for installing scikits-learn project / How to do it...
  • edge detection
    • about / Detecting edges, How to do it...
    • wikipedia, URL / Detecting edges
  • eigenvector
    • URL / The steady state vector determination
  • eig function / How to do it..., How it works...
  • endog attribute / How to do it..., How it works...
  • Euclid's formula
    • about / How to do it...
  • Euler constant
    • URL / Profiling Cython code
  • exog attribute / How it works...
  • extreme values
    • ignoring / Ignoring negative and extreme values, How to do it..., How it works...

F

  • factorial method / How to do it...
  • factorials approximation
    • with Cython / Approximating factorials with Cython, How to do it...
    • Cython code, writing / How to do it...
    • code, building / How to do it...
    • error, plotting / How to do it...
  • fancy indexing
    • about / Fancy indexing, How to do it..., How it works...
  • Fermat's factorization method
    • Wikipedia, URL / Finding prime factors
  • Fibonacci series
    • about / Summing Fibonacci numbers
    • wikipedia, URL / Summing Fibonacci numbers
  • fit method / How to do it...

G

  • GAE
    • about / Installing Google App Engine
    • installing, steps for / How to do it...
    • downloading / How to do it...
    • development environment / How to do it...
  • Gaussian filter
    • wikipedia, URL / Blurring images
  • gaussian_filter function / How it works...
  • generate function / How to do it...
  • get_include function / How it works...
  • golden ratio
    • wikipedia, URL / How to do it...
  • Google cloud
    • NumPy code, deploying / Deploying NumPy code in the Google cloud, How to do it..., How it works...

H

  • %hist command / How to do it...
  • harris function / How to do it...
  • hello.pyx code
    • writing / How to do it...
  • Hello World program
    • building / Building a Hello World program
    • building, steps for / How to do it...
    • hello.pyx code, writing / How to do it...
    • distutils setup.py script / How to do it...
  • help command / How to do it...
  • histogram function / How it works...
  • Hits column / How it works...
  • how parameter / How it works...

I

  • iirdesign function / How to do it...
  • images
    • resizing / Resizing images, How to do it..., How it works...
    • loading, into memory map / Loading images into memory map, How to do it..., How it works...
    • merging / Combining images, How to do it..., How it works...
    • blurring / Blurring images, How to do it..., How it works...
  • importr function / How to do it...
  • indexing
    • fancy indexing / Fancy indexing, How to do it..., How it works...
    • with list of locations / Indexing with a list of locations, How to do it...
    • with booleans / Indexing with booleans, How to do it..., How it works...
  • inline figures
    • web notebook, running with / How to do it...
  • interoperability
    • about / Introduction
  • IPython
    • about / Introduction
    • URL / Introduction
    • components / Introduction
    • in cloud URL / Introduction
    • installing, steps for / Installing IPython
    • installing, on Windows / How to do it...
    • installing, on Mac OS X / How to do it...
    • installing, on Linux / How to do it...
    • installing, with easy_install / How to do it...
    • installing, with pip / How to do it...
    • installing, from source / How to do it...
    • using, as shell / Using IPython as a shell, How to do it...
    • profiling with / Profiling with IPython, How it works...
    • debugging with / Debugging with IPython, How to do it..., How to do it...
  • IPython, installing
    • on Windows / How to do it...
    • on Mac OS X / How to do it...
    • on Linux / How to do it...
    • with pip / How to do it...
    • with easy_install / How to do it...
    • from source / How to do it...
  • IPython shell
    • pylab switch / How to do it...
    • using, ways for / How to do it...
    • session, saving / How to do it...
    • system shell command, executing / How to do it...
    • history, displaying / How to do it...

J

  • Java Native Interface (JNI) / How it works...
  • JPype
    • about / Installing JPype
    • installing, steps for / How to do it...
    • URL, for downloading / How to do it...
    • building / How to do it...
    • NumPy array, sending to / Sending a NumPy array to JPype, How to do it..., How it works...
  • Jython
    • about / Installing JPype

L

  • l command / How to do it...
  • lena function / How to do it...
  • lena image
    • flipping / Flipping Lena, How to do it...
  • linalg module / How to do it...
  • Line # column / How it works...
  • Line Contents column / How it works...
  • line_profiler
    • about / Installing line_profiler
    • installing, with easy_install / How to do it...
    • development version, installing / How to do it...
    • code, profiling with / Profiling code with line_profiler, How to do it..., How it works...
  • linspace function / How it works...
  • Linux
    • IPython, installing / How to do it...
    • Matplotlib, installing / How to do it...
    • Scipy, installing / How to do it...
    • Pyflakes, installing / How to do it...
  • list command / How to do it..., How to do it...
  • load function / How it works...
  • load_pandas method / How it works...
  • locations list
    • used, for indexing / Indexing with a list of locations, How to do it...
  • log function / Summing Fibonacci numbers, How it works..., Calling C functions, How it works...

M

  • Mac
    • Matplotlib, installing / How to do it...
  • Mac OS X
    • IPython, installing / How to do it...
    • Scipy, installing / How to do it...
  • MainHandler class / How to do it...
  • Mandelbrot fractal
    • wikipedia, URL / Combining images
  • manual pages
    • reading / Reading manual pages, How it works...
  • Markov chain
    • about / The steady state vector determination
  • masked array
    • creating / Creating a masked array, How it works...
    • creating, steps for / How to do it...
  • MaskedArray function / Creating a masked array
  • MATLAB
    • data, exchanging with / Exchanging data with MATLAB and Octave, How to do it...
  • Matplotlib
    • installing / Installing Matplotlib
  • Matplotlib, installing
    • on Windows / How to do it...
    • on Linux / How to do it...
    • from source / How to do it...
    • on Mac / How to do it...
  • memmap function / How to do it..., How it works...
  • memory map
    • images, loading into / Loading images into memory map, How to do it..., How it works...
    • loading into / How to do it...
  • merge sort algorithm / Profiling with timeit
  • meshgrid function / How to do it..., How it works..., How it works...
  • message type
    • [R] / How it works...
    • [C] / How it works...
    • [W] / How it works...
    • [E] / How it works...
    • [F] / How it works...
  • mocks
    • used, for testing code / Testing code with mocks, How to do it...
    • installing / How to do it...
    • creating / How to do it...
    • asset behavior / How to do it...
  • modf function / How to do it..., How it works...
  • mtcars dataset / How to do it...

N

  • ncalls column / How it works...
  • ndarray class / Stride tricks for Sudoku
  • ndarray module / How to do it...
  • negative values
    • ignoring / Ignoring negative and extreme values, How to do it..., How it works...
  • notebook server
    • about / Running a web notebook
    • configuring, steps for / Configuring a notebook server, How to do it..., How it works...
    • password, generating / How to do it...
    • SSL certificate, creating / How to do it...
    • server profile, creating / How to do it...
    • profile configuration file, editing / How to do it...
    • starting / How to do it...
  • NumPy
    • about / Introduction
    • Cython, using with / Using Cython with NumPy, How to do it..., How it works...
    • .pyx file, writing / How to do it...
    • setup.py file, writing / How to do it...
    • Cython module, using / How to do it...
    • log function / Calling C functions
    • diff function / How to do it...
  • numpy.ma module / Creating a masked array
  • numpy.random module / How it works...
  • numpy.recarray module / How it works...
  • numpy.testing.assert_equal function / How it works...
  • NumPy approximation
    • of e / How to do it...
  • NumPy array
    • sending, to Jype / Sending a NumPy array to JPype, How it works...
  • NumPy code
    • deploying, in Google cloud / Deploying NumPy code in the Google cloud, How to do it..., How it works...
    • running, in Python Anywhere web console / Running NumPy code in a Python Anywhere web console, How to do it..., How it works...

O

  • O(nlogn)
    • about / Profiling with timeit
  • Octave
    • data, exchanging with / Exchanging data with MATLAB and Octave, How to do it...
    • pointers, for installing / Getting ready
  • outer function / How to do it..., How it works..., How to do it...
  • outer method / How it works...

P

  • .pyx file / Building a Hello World program
    • writing / How to do it..., How to do it...
  • @profile decorator / How it works...
  • palindromic numbers
    • about / Finding palindromic numbers, How it works...
  • Pandas
    • about / Installing Pandas
    • installing / How to do it...
    • stock returns correlation, estimating / Estimating stock returns correlation with Pandas
    • time series data, resampling / Resampling time series data, How to do it..., How it works...
  • pandas.DataFrame.corr method / How it works...
  • pandas.DataFrame.plot method / How it works...
  • pandas.DataFrame method / How it works...
  • Pareto principle
    • URL / Discovering a power law
  • patsy
    • installing / Getting ready
  • percall column / How it works...
  • Per Hit column / How it works...
  • PiCloud
    • about / Setting up PiCloud, How to do it...
    • URL / Setting up PiCloud
    • working / How it works...
  • PIL
    • installing, on Windows / How to do it...
    • installing, on Debian / How to do it...
    • installing, on Ubuntu / How to do it...
    • installing, with easy_install / How to do it...
    • installing, with rip / How to do it...
    • about / Using the buffer protocol
  • pip
    • IPython, installing with / How to do it...
    • used, for installing SciPy / How to do it...
    • used, for installing PIL / How to do it...
    • used, for installing RPy2 / How to do it...
    • used, for installing Pyflakes / How to do it...
    • used, for installing Cython / How to do it...
  • polar function / How it works...
  • polar rose
    • wikipedia, URL / Blurring images
  • polyfit function / How it works..., How it works...
  • polyval function / How it works...
  • power law
    • discovering / Discovering a power law, How to do it...
  • prime factors
    • Wikipedia, URL / Finding prime factors
    • finding / How to do it...
  • profiler output
    • ncalls column / How it works...
    • tottime column / How it works...
    • percall column / How it works...
    • cumtime column / How it works...
  • profiling
    • with IPython / Profiling with IPython
    • snippet, timing / How to do it...
    • script, profiling / How to do it...
  • pudb
    • debugging with / Debugging with pudb, How to do it...
    • installing / How to do it...
  • py26-scikits-learn / Installing scikits-learn
  • py27-scikits-learn / Installing scikits-learn
  • Pychecker
    • static analysis, performing / Performing static analysis with Pychecker
  • Pyflakes
    • about / Installing Pyflakes
    • installing, with pip / How to do it...
    • installing, with easy_install / How to do it...
    • installing, on Linux / How to do it...
    • static analysis, performing / Performing static analysis with Pyflakes, How it works...
  • pylab mode
    • web notebook, running / How to do it...
  • pylab switch / How to do it...
  • Pylint
    • about / Analyzing code with Pylint
    • installing, from source distribution / Getting ready
    • working / How it works...
  • Pythagorean triple
    • wikipedia, URL / Finding Pythagorean triples
  • Pythagorean triples
    • finding / Finding Pythagorean triples, How it works...
  • python-pandas project / How to do it...
  • python-sklearn / Installing scikits-learn
  • Python Anywhere web console
    • NumPy code, running / Running NumPy code in a Python Anywhere web console, How to do it..., How it works...
  • Python Image Library (PIL) / Introduction

Q

  • quicksort algorithm / Profiling with timeit

R

  • R
    • interfacing with / Interfacing with R, How to do it...
  • rand function / How it works...
  • randint function / How it works..., How it works...
  • randn function / How it works...
  • random
    • trading, simulating at / Simulating trading at random, How to do it..., How it works...
  • random_integers function / How it works..., How it works..., How it works...
  • ravel function / How to do it..., How it works...
  • recarray
    • score tables, creating with / Creating a scores table with recarray, How to do it..., How it works...
  • recarray class / Creating a scores table with recarray
  • repeat function / How it works...
  • resample method / How to do it...
  • RPy2
    • installing / Installing RPy2
    • installing, steps for / How to do it...
    • installing, with pip / How to do it...
    • installing, with easy_install / How to do it...
    • installing, from source / How to do it...

S

  • savemat function / Exchanging data with MATLAB and Octave
  • Scikits
    • about / Introduction
  • Scikits, projects
    • scikits-learn / Introduction
    • scikits-statsmodels / Introduction
    • scikits-image / Introduction
    • pandas / Introduction
  • scikits-image
    • about / Installing scikits-image
  • scikits-learn project
    • about / Installing scikits-learn
    • installing, with easy_install / How to do it...
    • installing, from source / How to do it...
    • example dataset, loading / Loading an example dataset
    • Dow Jones stocks, clustering / Clustering Dow Jones stocks with scikits-learn, How to do it..., How it works...
  • scikits-statsmodels package
    • about / Installing scikits-statsmodels
    • binaries downloading, URL / How to do it...
    • source downloading, URL / How to do it...
    • normality test, performing / Performing a normality test with scikits-statsmodels, How it works...
  • SciPy
    • about / Installing SciPy
    • installing, from source / How to do it...
    • installing, on Linux / How to do it...
    • installing, on Mac OS X / How to do it...
    • installing, easy_install used / How to do it...
    • installing, rip used / How to do it...
    • installing, on Windows / How to do it...
    • installation, checking / How to do it...
  • scipy.signal.iirdesign function / How it works...
  • Scipy.signal.lfilter function / How it works...
  • score tables
    • creating, with recarray / Creating a scores table with recarray, How to do it..., How it works...
  • semilogx function / How it works...
  • server profile
    • creating / How to do it...
  • setup.py file
    • writing / How to do it...
  • setup tools
    • installing, on Windows / How to do it...
    • used, for installing Cython / How to do it...
  • shell
    • IPython, using as / Using IPython as a shell
  • Sieve of Erasthothenes
    • integers, sieving with / Sieving integers with the Sieve of Erasthothenes
  • Sieve of Eratosthenes
    • URL / Sieving integers with the Sieve of Erasthothenes
  • sign function / How it works...
  • sinc function
    • plotting / How to do it...
  • sklearn.cluster.AffinityPropagation() function / How it works...
  • sklearn.cluster.AffinityPropagation.fit function / How it works...
  • Sobel filter
    • edge detection with / Edge detection with the Sobel filter, How to do it..., How it works...
  • Sobel operator
    • URL / Edge detection with the Sobel filter
  • sort method / How to do it...
  • sounds
    • generating / Generating sounds, How to do it...
  • splitlines function / How to do it...
  • sqrt function / Summing Fibonacci numbers, How to do it..., How it works...
  • SSL certificate
    • creating / How to do it...
  • standard deviation of log returns
    • wikipedia, URL / Creating a scores table with recarray
  • static analysis
    • performing, with Pyflakes / Performing static analysis with Pyflakes, How to do it..., How it works..., Performing static analysis with Pychecker
  • statsmodels
    • data, loading as pandas objects / Loading data as pandas objects from statsmodels, How to do it..., How it works...
  • steady state
    • URL / The steady state vector determination
    • about / How to do it...
  • stirling approximation method
    • URL / Approximating factorials with Cython
  • stochastic matrix
    • URL / The steady state vector determination
  • stride tricks
    • for Sudoku / Stride tricks for Sudoku, How to do it..., How it works...
  • string operations
    • performing, with chararray object / Performing string operations with chararray, How it works...
    • performing, with chararray / Performing string operations with chararray
  • subplot function / How to do it...
  • Sudoku
    • stride tricks for / Stride tricks for Sudoku, How to do it..., How it works...
    • wikipedia, URL / Stride tricks for Sudoku
  • sum function / Summing Fibonacci numbers, How it works..., How it works...
  • SymPy profile
    • exploring / Exploring the SymPy profile
    • installing, easy_install used / Getting ready, How to do it...
    • installing, pip used / Getting ready, How to do it...

T

  • % Time column / How it works...
  • take function / How to do it..., How it works...
  • tarball (.tar archive)
    • used, for installing Cython / How to do it...
  • TDD
    • about / Writing unit tests
  • TestCase class / How to do it...
  • Time column / How it works...
  • timeit
    • about / Profiling with timeit
    • arrays, creating to sort / How to do it...
    • measure time / How to do it...
    • measurement time arrays, building / How to do it...
    • nlogn, fitting to / How to do it...
    • random_integers function / How it works...
    • append function / How it works...
    • polyfit function / How it works...
    • polyval function / How it works...
    • semilogx function / How it works...
  • time series data
    • resampling, with Pandas / Resampling time series data, How to do it..., How it works...
  • tofile function / How to do it..., How it works...
  • tottime column / How it works...
  • trading
    • simulating, at random / Simulating trading at random, How to do it..., How it works...
  • tuple / How to do it...

U

  • Ubunty
    • PIL, installing / How to do it...
  • u command / How to do it...
  • unittest.assertEqual function / How it works...
  • unittest.assertRaises function / How it works...
  • unit tests
    • about / Writing unit tests
    • writing / How to do it...
    • implementing, standard unittest Python module used / How it works...
  • universal function
    • about / Introduction
    • creating / Creating a universal function, How it works...
    • creating, steps for / How to do it...
  • U state / How to do it...

V

  • Vi (m) editor / Introduction
  • views
    • creating / Creating views and copies, How to do it..., How it works...

W

  • web notebook
    • running / Running a web notebook, How to do it...
    • features / Running a web notebook
    • running, in pylab mode / How to do it...
    • running, with inline figures / How to do it...
    • creating / How to do it...
    • array, creating / How to do it...
    • sinc function, plotting / How to do it...
    • exporting / Exporting a web notebook
    • exporting, print option used / How to do it...
    • downloading / How to do it...
    • saving / How to do it...
    • importing, steps for / Importing a web notebook, How to do it...
  • web notebook, exporting
    • via print option / How to do it...
    • via download button / How to do it...
    • via save notebook option / How to do it...
  • where function / How to do it..., How it works...
  • Windows
    • setup tools, installing / How to do it...
    • Matplotlib, installing / How to do it...
    • SciPy, installing / How to do it...
    • PIL, installing / How to do it...
  • Windows installers
    • used, for installing Cython / How to do it...

Z

  • zeros function / How to do it..., How it works...
lock icon The rest of the chapter is locked
arrow left Previous Chapter
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 $15.99/month. Cancel anytime}