NumPy Cookbook doc

226 1000 0
NumPy Cookbook doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... some of NumPy' s more advanced and tricky indexing techniques NumPy has very efficient arrays that are easy to use due to their powerful indexing mechanism Chapter 3, Get to Grips with Commonly Used Functions, makes an attempt to document the most essential functions that every NumPy user should know NumPy has many functions, too many to even mention in this book Preface Chapter 4, Connecting NumPy with... Preface We, NumPy users, live in exciting times New NumPy- related developments seem to come to our attention every week or maybe even daily When this book was being written, NumPy Foundation of Open Code for Usable Science was created The Numba project NumPy- aware, dynamic Python compiler using LLVM—was announced Also, Google added... on the Cloud, and some of it lives on your local machine or a remote server Being able to fit and connect NumPy in such an environment is just as important as being able to write standalone NumPy code Chapter 5, Audio and Image Processing, shows you a different view of NumPy So when you think of NumPy after reading this chapter, you'll probably think of sounds or images too Chapter 6, Special Arrays... samples in this book, you will need a recent build of NumPy This means that you will need to have one of the Python versions supported by NumPy as well Recipes to install other relevant software packages are provided throughout the book Who this book is for This book is for scientists, engineers, programmers, or analysts, with a basic knowledge of Python and NumPy, who want to go to the next level Also, some... is dependent on readline, so you need to make sure it is installed The question mark gives you information from docstrings Installing Matplotlib Matplotlib is a very useful plotting library, which we will need for the next recipe It depends on NumPy, but in all likelihood you already have NumPy installed How to do it We will see how Matplotlib can be installed in Windows, Linux, and Mac, and also how... vector to be added contains the squares of 0 up to n The second vector contains the cubes of 0 up to n The program prints the last 2 elements of the sum and the elapsed time """ def numpysum(n): a = numpy. arange(n) ** 2 b = numpy. arange(n) ** 3 c = a + b return c def pythonsum(n): a = range(n) b = range(n) c = [] for i in range(len(a)): a[i] = i ** 2 b[i] = i ** 3 c.append(a[i] + b[i]) return c # ... application Chapter 8, Quality Assurance, will discuss common methods and techniques such as unit testing, mocking, and BDD, including the NumPy testing utilities, as quality assurance deserves a lot of attention Chapter 9, Speed Up Code with Cython, shows how Cython works from the NumPy perspective Cython tries to combine the speed of C and the strengths of Python Chapter 10, Fun with Scikits, gives us a quick... code cell is indicated with the following tag: # The following is the tagged code: # 2 #!/usr/bin/env/python from datetime import datetime import numpy 17 Winding Along with IPython """ Chapter 1 of NumPy Beginners Guide This program demonstrates vector addition the Python way Run from the command line as follows python vectorsum.py n where n is an integer that specifies... Cloud product Google App Engine In the future, we can expect improved concurrency support for clusters of GPUs and CPUs OLAP-like queries will be possible with NumPy arrays This is wonderful news, but we have to keep reminding ourselves that NumPy is not alone in the scientific (Python) software ecosystem There is Scipy, Matplotlib (a very useful Python plotting library), IPython (an interactive shell),... print "The last 2 elements of the sum", c[-2:] print "PythonSum elapsed time in microseconds", delta.microseconds # start = datetime.now() c = numpysum(size) delta = datetime.now() - start print "The last 2 elements of the sum", c[-2:] print "NumPySum elapsed time in microseconds", delta.microseconds The code is split into several cells according to the tags, as shown in the following screenshot: . alt="" NumPy Cookbook Over 70 interesting recipes for learning the Python open source mathematical library, NumPy Ivan Idris BIRMINGHAM - MUMBAI NumPy Cookbook Copyright. 82 Installing JPype 84 Sending a NumPy array to JPype 84 Installing Google App Engine 86 Deploying NumPy code in the Google cloud 88 Running NumPy code in a Python

Ngày đăng: 06/03/2014, 03:20

Từ khóa liên quan

Mục lục

  • Cover

  • Copyright

  • Credits

  • About the Author

  • About the Reviewers

  • www.PacktPub.com

  • Table of Contents

  • Preface

  • Chapter 1: Winding Along with IPython

    • Introduction

    • Installing IPython

    • Using IPython as a shell

    • Reading manual pages

    • Installing Matplotlib

    • Running a web notebook

    • Exporting a web notebook

    • Importing a web notebook

    • Configuring a notebook server

    • Exploring the SymPy profile

    • Chapter 2: Advanced Indexing and Array Concepts

      • Introduction

      • Installing SciPy

Tài liệu cùng người dùng

Tài liệu liên quan