Learning NumPy Array
eBook - ePub

Learning NumPy Array

Ivan Idris

Share book
  1. 164 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning NumPy Array

Ivan Idris

Book details
Book preview
Table of contents
Citations

About This Book

In Detail

NumPy is an extension of Python, which provides highly optimized arrays and numerical operations. NumPy replaces a lot of the functionality of Matlab and Mathematica specifically vectorized operations, but in contrast to those products is free and open source. In today's world of science and technology, it is all about speed and flexibility.

This book will teach you about NumPy, a leading scientific computing library. This book enables you to write readable, efficient, and fast code, which is closely associated to the language of mathematics. Save thousands of dollars on expensive software, while keeping all the flexibility and power of your favorite programming language.

You will learn about installing and using NumPy and related concepts. At the end of the book we will explore related scientific computing projects. This book will give you a solid foundation in NumPy arrays and universal functions. Learning NumPy Array will help you be productive with NumPy and write clean and fast code.

Approach

A step-by-step guide, packed with examples of practical numerical analysis that will give you a comprehensive, but concise overview of NumPy.

Who this book is for

This book is for programmers, scientists, or engineers, who have basic Python knowledge and would like to be able to do numerical computations with Python.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Learning NumPy Array an online PDF/ePUB?
Yes, you can access Learning NumPy Array by Ivan Idris in PDF and/or ePUB format, as well as other popular books in Computer Science & Databases. We have over one million books available in our catalogue for you to explore.

Information

Year
2014
ISBN
9781783983902
Edition
1

Learning NumPy Array


Table of Contents

Learning NumPy Array
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with NumPy
Python
Installing NumPy, Matplotlib, SciPy, and IPython on Windows
Installing NumPy, Matplotlib, SciPy, and IPython on Linux
Installing NumPy, Matplotlib, and SciPy on Mac OS X
Building from source
NumPy arrays
Adding arrays
Online resources and help
Summary
2. NumPy Basics
The NumPy array object
The advantages of using NumPy arrays
Creating a multidimensional array
Selecting array elements
NumPy numerical types
Data type objects
Character codes
dtype constructors
dtype attributes
Creating a record data type
One-dimensional slicing and indexing
Manipulating array shapes
Stacking arrays
Splitting arrays
Array attributes
Converting arrays
Creating views and copies
Fancy indexing
Indexing with a list of locations
Indexing arrays with Booleans
Stride tricks for Sudoku
Broadcasting arrays
Summary
3. Basic Data Analysis with NumPy
Introducing the dataset
Determining the daily temperature range
Looking for evidence of global warming
Comparing solar radiation versus temperature
Analyzing wind direction
Analyzing wind speed
Analyzing precipitation and sunshine duration
Analyzing monthly precipitation in De Bilt
Analyzing atmospheric pressure in De Bilt
Analyzing atmospheric humidity in De Bilt
Summary
4. Simple Predictive Analytics with NumPy
Examining autocorrelation of average temperature with pandas
Describing data with pandas DataFrames
Correlating weather and stocks with pandas
Predicting temperature
Autoregressive model with lag 1
Autoregressive model with lag 2
Analyzing intra-year daily average temperatures
Introducing the day-of-the-year temperature model
Modeling temperature with the SciPy leastsq function
Day-of-year temperature take two
Moving-average temperature model with lag 1
The Autoregressive Moving Average temperature model
The time-dependent temperature mean adjusted autoregressive model
Outliers analysis of average De Bilt temperature
Using more robust statistics
Summary
5. Signal Processing Techniques
Introducing the Sunspot data
Sifting continued
Moving averages
Smoothing functions
Forecasting with an ARMA model
Filtering a signal
Designing the filter
Demonstrating cointegration
Summary
6. Profiling, Debugging, and Testing
Assert functions
The assert_almost_equal function
Approximately equal arrays
The assert_array_almost_equal function
Profiling a program with IPython
Debugging with IPython
Performing Unit tests
Nose tests decorators
Summary
7. The Scientific Python Ecosystem
Numerical integration
Interpolation
Using Cython with NumPy
Clustering stocks with scikit-learn
Detecting corners
Comparing NumPy to Blaze
Summary
Index

Learning NumPy Array

Copyright © 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: June 2014
Production Reference: 1060614
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-390-2
www.packtpub.com
Cover Image by Duraid Fatouhi ()

Credits

Author
Ivan Idris
Reviewers
Jonathan Bright
Jaidev Deshpande
Mark Livingstone
MiklĂłs PrisznyĂĄk
Commissioning Editor
Kartikey Pandey
Acquisition Editor
Mohammad Rizvi
Content Development Editor
Akshay Nair
Technical Editors
Shubhangi H. Dhamgaye
Shweta S. Pant
Copy Editor
Sarang Chari
Project Coordinator
Lima Danti
Proofreaders
Maria Gould
Kevin McGowen
Indexer
Hemangini Bari
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta

About the Author

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. He enjoys writing clean, testable code and interesting technical articles. He is the author of NumPy 1.5 Beginner's Guide and NumPy Cookbook, Packt Publishing. You can find more information and a blog with a few NumPy examples at ivanidris.net.

Table of contents