Guide To NumPy - MIT

2y ago
48 Views
4 Downloads
2.03 MB
371 Pages
Last View : 9d ago
Last Download : 3m ago
Upload by : Genevieve Webb
Transcription

Guide to NumPyTravis E. Oliphant, PhDDec 7, 2006This book is under restricted distribution using a Market-Determined, Temporary, Distribution-Restriction (MDTDR) system (see http://www.trelgol.com) untilOctober 31, 2010 at the latest. If you receive this book, you are asked not to copy itin any form (electronic or paper) until the temporary distribution-restriction lapses.If you have multiple users at an institution, you should either share a single copyusing some form of digital library check-out, or buy multiple copies. The morecopies purchased, the sooner the documentation can be released from this inconvenient distribution restriction. After October 31, 2010 this book may be freelycopied in any format and used as source material for other books as long as acknowledgement of the original author is given. Your support of this temporarydistribution restriction plays an essential role in allowing the author and others likehim to produce more quality books and software.1

ContentsINumPy from Python121 Origins of NumPy132 Object Essentials182.12.2Data-Type Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . .Basic indexing (slicing) . . . . . . . . . . . . . . . . . . . . . . . . . .19232.3Memory Layout of ndarray . . . . . . . . . . . . . . . . . . . . . .2.3.1 Contiguous Memory Layout . . . . . . . . . . . . . . . . . . .26262.42.3.2 Non-contiguous memory layout . . . . . . . . . . . . . . . . .Universal Functions for arrays . . . . . . . . . . . . . . . . . . . . . .28302.52.6Summary of new features . . . . . . . . . . . . . . . . . . . . . . . .Summary of differences with Numeric . . . . . . . . . . . . . . . . .32342.6.1First-step changes . . . . . . . . . . . . . . . . . . . . . . . .342.6.22.6.3Second-step changes . . . . . . . . . . . . . . . . . . . . . . .Updating code that uses Numeric using alter codeN . . . . .37382.6.4 Changes to think about . . . . . . . . . . . . . . . . . . . . .Summary of differences with Numarray . . . . . . . . . . . . . . . .39402.7.1First-step changes . . . . . . . . . . . . . . . . . . . . . . . .2.7.1.1 Import changes . . . . . . . . . . . . . . . . . . . . .41412.7.22.7.1.2 Attribute and method changes . . . . . . . . . . . .Second-step changes . . . . . . . . . . . . . . . . . . . . . . .42432.7.3Additional Extension modules . . . . . . . . . . . . . . . . . .432.73 The Array Object3.145ndarray Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . .3.1.1 Memory Layout attributes . . . . . . . . . . . . . . . . . . . .45453.1.249Data Type attributes. . . . . . . . . . . . . . . . . . . . . .2

3.1.33.23.33.4Other attributes . . . . . . . . . . . . . . . . . . . . . . . . .503.1.4 Array Interface attributes . . . . . . . . . . . . . . . . . . . .ndarray Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . .52543.2.13.2.2Array conversion . . . . . . . . . . . . . . . . . . . . . . . . .Array shape manipulation . . . . . . . . . . . . . . . . . . . .54593.2.33.2.4Array item selection and manipulation . . . . . . . . . . . . .Array calculation . . . . . . . . . . . . . . . . . . . . . . . . .6165Array Special Methods . . . . . . . . . . . . . . . . . . . . . . . . . .3.3.1 Methods for standard library functions . . . . . . . . . . . . .71713.3.23.3.3Basic customization . . . . . . . . . . . . . . . . . . . . . . .Container customization . . . . . . . . . . . . . . . . . . . . .72743.3.4Arithmetic customization . . . . . . . . . . . . . . . . . . . .3.3.4.1 Binary . . . . . . . . . . . . . . . . . . . . . . . . .75753.3.4.23.3.4.3In-place . . . . . . . . . . . . . . . . . . . . . . . . .Unary operations . . . . . . . . . . . . . . . . . . .7778Array indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .793.4.13.4.2Basic Slicing . . . . . . . . . . . . . . . . . . . . . . . . . . .Advanced selection . . . . . . . . . . . . . . . . . . . . . . . .79813.4.2.13.4.2.2Integer . . . . . . . . . . . . . . . . . . . . . . . . .Boolean . . . . . . . . . . . . . . . . . . . . . . . . .8183Flat Iterator indexing . . . . . . . . . . . . . . . . . . . . . .843.4.34 Basic Routines854.14.2Creating arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Operations on two or more arrays . . . . . . . . . . . . . . . . . . . .85904.34.4Printing arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Functions redundant with methods . . . . . . . . . . . . . . . . . .93944.5Dealing with data types . . . . . . . . . . . . . . . . . . . . . . . . .945 Additional Convenience Routines965.1Shape functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.25.3Basic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100Polynomial functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 1085.45.5Set Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111Array construction using index tricks . . . . . . . . . . . . . . . . . . 1125.65.7Other indexing devices . . . . . . . . . . . . . . . . . . . . . . . . . . 115Two-dimensional functions . . . . . . . . . . . . . . . . . . . . . . . . 116396

5.8More data type functions . . . . . . . . . . . . . . . . . . . . . . . . 1185.9 Functions that behave like ufuncs . . . . . . . . . . . . . . . . . . . . 1215.10 Miscellaneous Functions . . . . . . . . . . . . . . . . . . . . . . . . . 1215.11 Utility functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1246 Scalar objects1266.16.2Attributes of array scalars . . . . . . . . . . . . . . . . . . . . . . . . 127Methods of array scalars . . . . . . . . . . . . . . . . . . . . . . . . . 1296.3Defining New Types . . . . . . . . . . . . . . . . . . . . . . . . . . . 1307 Data-type (dtype) Objects1317.17.2Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1337.3Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1378 Standard Classes1388.1Special attributes and methods recognized by NumPy . . . . . . . . 1398.28.3Matrix Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139Memory-mapped-file arrays . . . . . . . . . . . . . . . . . . . . . . . 1428.48.5Character arrays (numpy.char) . . . . . . . . . . . . . . . . . . . . . 143Record Arrays (numpy.rec) . . . . . . . . . . . . . . . . . . . . . . . 1448.68.7Masked Arrays (numpy.ma) . . . . . . . . . . . . . . . . . . . . . . . 148Standard container class . . . . . . . . . . . . . . . . . . . . . . . . . 1498.8Array Iterators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1498.8.1 Default iteration . . . . . . . . . . . . . . . . . . . . . . . . . 1508.8.28.8.3Flat iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . 150N-dimensional enumeration . . . . . . . . . . . . . . . . . . . 1518.8.4Iterator for broadcasting . . . . . . . . . . . . . . . . . . . . . 1519 Universal Functions9.1153Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1539.1.19.1.2Broadcasting . . . . . . . . . . . . . . . . . . . . . . . . . . . 154Output type determination . . . . . . . . . . . . . . . . . . . 1549.1.39.1.4Use of internal buffers . . . . . . . . . . . . . . . . . . . . . . 155Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . 1559.29.1.5 Optional keyword arguments . . . . . . . . . . . . . . . . . . 156Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1579.3Casting Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1584

9.49.5Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1599.4.19.4.2Reduce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161Accumulate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1619.4.39.4.4Reduceat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162Outer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163Available ufuncs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1649.5.1 Math operations . . . . . . . . . . . . . . . . . . . . . . . . . 1649.5.29.5.3Trigonometric functions . . . . . . . . . . . . . . . . . . . . . 167Bit-twiddling functions . . . . . . . . . . . . . . . . . . . . . . 1689.5.49.5.5Comparison functions . . . . . . . . . . . . . . . . . . . . . . 169Floating functions . . . . . . . . . . . . . . . . . . . . . . . . 17110 Basic Modules17410.1 Linear Algebra (linalg) . . . . . . . . . . . . . . . . . . . . . . . . 17410.2 Discrete Fourier Transforms (fft) . . . . . . . . . . . . . . . . . . . 17710.3 Random Numbers (random) . . . . . . . . . . . . . . . . . . . . . . 18110.3.1 Discrete Distributions . . . . . . . . . . . . . . . . . . . . . . 18110.3.2 Continuous Distributions . . . . . . . . . . . . . . . . . . . . 18410.3.3 Miscellaneous utilities . . . . . . . . . . . . . . . . . . . . . . 19010.4 Matrix-specific functions (matlib) . . . . . . . . . . . . . . . . . . . . 19110.5 Ctypes utiltity functions (ctypeslib) . . . . . . . . . . . . . . . . . . 19111 Testing and Packaging19211.1 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19211.2 NumPy Distutils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19411.2.1 misc util . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19411.2.2 Other modules . . . . . . . . . . . . . . . . . . . . . . . . . . 20211.3 Conversion of .src files . . . . . . . . . . . . . . . . . . . . . . . . . . 20311.3.1 Fortran files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20311.3.1.1 Named repeat rule . . . . . . . . . . . . . . . . . . . 20411.3.1.2 Short repeat rule . . . . . . . . . . . . . . . . . . . . 20411.3.1.3 Pre-defined names . . . . . . . . . . . . . . . . . . . 20411.3.2 Other files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205IIC-API20612 New Python Types and C-Structures5207

12.1 New Python Types Defined . . . . . . . . . . . . . . . . . . . . . . . 20812.1.1 PyArray Type . . . . . . . . . . . . . . . . . . . . . . . . . . 20912.1.2 PyArrayDescr Type . . . . . . . . . . . . . . . . . . . . . . . 21012.1.3 PyUFunc Type . . . . . . . . . . . . . . . . . . . . . . . . . . 21812.1.4 PyArrayIter Type . . . . . . . . . . . . . . . . . . . . . . . . 22012.1.5 PyArrayMultiIter Type . . . . . . . . . . . . . . . . . . . . . 22212.1.6 PyArrayFlags Type . . . . . . . . . . . . . . . . . . . . . . . 22312.1.7 ScalarArrayTypes . . . . . . . . . . . . . . . . . . . . . . . . 22312.2 Other C-Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22412.2.1 PyArray Dims . . . . . . . . . . . . . . . . . . . . . . . . . . 22412.2.2 PyArray Chunk . . . . . . . . . . . . . . . . . . . . . . . . . . 22412.2.3 PyArrayInterface . . . . . . . . . . . . . . . . . . . . . . . . . 22512.2.4 Internally used structures . . . . . . . . . . . . . . . . . . . . 22612.2.4.1 PyUFuncLoopObject . . . . . . . . . . . . . . . . . 22712.2.4.2 PyUFuncReduceObject . . . . . . . . . . . . . . . . 22712.2.4.3 PyUFunc Loop1d . . . . . . . . . . . . . . . . . . . 22712.2.4.4 PyArrayMapIter Type13 Complete API. . . . . . . . . . . . . . . . 22722813.1 Configuration defines . . . . . . . . . . . . . . . . . . . . . . . . . . . 22813.1.1 Guaranteed to be defined . . . . . . . . . . . . . . . . . . . . 22813.1.2 Possible defines . . . . . . . . . . . . . . . . . . . . . . . . . . 22913.2 Array Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22913.2.1 Enumerated Types . . . . . . . . . . . . . . . . . . . . . . . . 23013.2.2 Defines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23113.2.2.1 Max and min values for integers . . . . . . . . . . . 23113.2.2.2 Number of bits in data types . . . . . . . . . . . . . 23113.2.2.3 Bit-width references to enumerated typenums . . . . 23113.2.2.4 Integer that can hold a pointer . . . . . . . . . . . . 23213.2.3 C-type names . . . . . . . . . . . . . . . . . . . . . . . . . . . 23213.2.3.1 Boolean . . . . . . . . . . . . . . . . . . . . . . . . . 23213.2.3.2 (Un)Signed Integer . . . . . . . . . . . . . . . . . . 23213.2.3.3 (Complex) Floating point . . . . . . . . . . . . . . . 23313.2.3.4 Bit-width names . . . . . . . . . . . . . . . . . . . . 23313.2.4 Printf Formatting . . . . . . . . . . . . . . . . . . . . . . . . 23313.3 Array API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23313.3.1 Array structure and data access6. . . . . . . . . . . . . . . . 233

13.3.1.1 Data access . . . . . . . . . . . . . . . . . . . . . . . 23513.3.2 Creating arrays . . . . . . . . . . . . . . . . . . . . . . . . . . 23613.3.2.1 From scratch . . . . . . . . . . . . . . . . . . . . . . 23613.3.2.2 From other objects . . . . . . . . . . . . . . . . . . . 23813.3.3 Dealing with types . . . . . . . . . . . . . . . . . . . . . . . . 24413.3.3.1 General check of Python Type . . . . . . . . . . . . 24413.3.3.2 Data-type checking . . . . . . . . . . . . . . . . . . 24613.3.3.3 Converting data types . . . . . . . . . . . . . . . . . 24913.3.3.4 New data types . . . . . . . . . . . . . . . . . . . . 25113.3.3.5 Special functions for PyArray OBJECT . . . . . . . 25213.3.4 Array flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25313.3.4.1 Basic Array Flags . . . . . . . . . . . . . . . . . . . 25313.3.4.2 Combinations of array flags . . . . . . . . . . . . . . 25413.3.4.3 Flag-like constants . . . . . . . . . . . . . . . . . . 25413.3.4.4 Flag checking . . . . . . . . . . . . . . . . . . . . . . 25513.3.5 Array method alternative API . . . . . . . . . . . . . . . . . 25613.3.5.1 Conversion . . . . . . . . . . . . . . . . . . . . . . . 25613.3.5.2 Shape Manipulation . . . . . . . . . . . . . . . . . . 25813.3.5.3 Item selection and manipulation . . . . . . . . . . . 26013.3.5.4 Calculation . . . . . . . . . . . . . . . . . . . . . . . 26313.3.6 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26513.3.6.1 Array Functions . . . . . . . . . . . . . . . . . . . . 26513.3.6.2 Other functions . . . . . . . . . . . . . . . . . . . . 26713.3.7 Array Iterators . . . . . . . . . . . . . . . . . . . . . . . . . . 26813.3.8 Broadcasting (multi-iterators) . . . . . . . . . . . . . . . . . . 26913.3.9 Array Scalars . . . . . . . . . . . . . . . . . . . . . . . . . . . 27113.3.10 Data-type descriptors . . . . . . . . . . . . . . . . . . . . . . 27313.3.11 Conversion Utilities . . . . . . . . . . . . . . . . . . . . . . . 27513.3.11.1 For use with PyArg ParseTuple . . . . . . . . . . 27513.3.11.2 Other conversions . . . . . . . . . . . . . . . . . . . 27713.3.12 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . 27813.3.12.1 Importing the API . . . . . . . . . . . . . . . . . . . 27813.3.12.2 Internal Flexibility . . . . . . . . . . . . . . . . . . . 27913.3.12.3 Memory management . . . . . . . . . . . . . . . . . 28013.3.12.4 Threading support . . . . . . . . . . . . . . . . . . . 28013.3.12.5 Priority . . . . . . . . . . . . . . . . . . . . . . . . . 28213.3.12.6 Default buffers . . . . . . . . . . . . . . . . . . . . . 2827

13.3.12.7 Other constants . . . . . . . . . . . . . . . . . . . . 28213.3.12.8 Miscellaneous Macros . . . . . . . . . . . . . . . . . 28313.3.12.9 Enumerated Types . . . . . . . . . . . . . . . . . . . 28413.4 UFunc API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28413.4.1 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28413.4.2 Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28513.4.3 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28513.4.4 Generic functions . . . . . . . . . . . . . . . . . . . . . . . . . 28813.5 Importing the API . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29014 How to extend NumPy29214.1 Writing an extension module . . . . . . . . . . . . . . . . . . . . . . 29214.2 Required subroutine . . . . . . . . . . . . . . . . . . . . . . . . . . . 29314.3 Defining functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29414.3.1 Functions without keyword arguments . . . . . . . . . . . . . 29514.3.2 Functions with keyword arguments . . . . . . . . . . . . . . . 29614.3.3 Reference counting . . . . . . . . . . . . . . . . . . . . . . . . 29714.4 Dealing with array objects . . . . . . . . . . . . . . . . . . . . . . . . 29814.4.1 Converting an arbitrary sequence object . . . . . . . . . . . . 29914.4.2 Creating a brand-new ndarray . . . . . . . . . . . . . . . . . 30114.4.3 Getting at ndarray memory and accessing elements of thendarray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30314.5 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30315 Beyond the Basics30515.1 Iterating over elements in the array . . . . . . . . . . . . . . . . . . . 30515.1.1 Basic Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . 30515.1.2 Iterating over all but one axis . . . . . . . . . . . . . . . . . . 30715.1.3 Iterating over multiple arrays . . . . . . . . . . . . . . . . . . 30715.1.4 Broadcasting over multiple arrays . . . . . . . . . . . . . . . 30815.2 Creating a new universal function . . . . . . . . . . . . . . . . . . . . 30915.3 User-defined data-types . . . . . . . . . . . . . . . . . . . . . . . . . 31215.3.1 Adding the new data-type . . . . . . . . . . . . . . . . . . . . 31215.3.2 Registering a casting function . . . . . . . . . . . . . . . . . . 31315.3.3 Registering coercion rules . . . . . . . . . . . . . . . . . . . . 31415.3.4 Registering a ufunc loop . . . . . . . . . . . . . . . . . . . . . 31515.4 Subtyping the ndarray in C . . . . . . . . . . . . . . . . . . . . . . . 3158

15.4.1 Creating sub-types . . . . . . . . . . . . . . . . . . . . . . . . 31615.4.2 Specific features of ndarray sub-typing . . . . . . . . . . . . . 31715.4.2.1 The array finalize method . . . . . . . . . . . . . 31715.4.2.2 The15.4.2.3 Thearray priority attribute . . . . . . . . . . . . 318array wrap method . . . . . . . . . . . . . . 31816 Using Python as glue31916.1 Calling other compiled libraries from Python . . . . . . . . . . . . . 32016.2 Hand-generated wrappers . . . . . . . . . . . . . . . . . . . . . . . . 32016.3 f2py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32116.3.1 Creating source for a basic extension module . . . . . . . . . 32116.3.2 Creating a compiled extension module . . . . . . . . . . . . . 32216.3.3 Improving the basic interface . . . . . . . . . . . . . . . . . . 32316.3.4 Inserting directives in Fortran source . . . . . . . . . . . . . . 32416.3.5 A filtering example . . . . . . . . . . . . . . . . . . . . . . . . 32516.3.6 Calling f2py from Python . . . . . . . . . . . . . . . . . . . . 32616.3.7 Automatic extension module generation . . . . . . . . . . . . 32616.3.8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32716.4 weave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32816.4.1 Speed up code involving arrays (also see scipy.numexpr) . . . 32816.4.2 Inline C-code . . . . . . . . . . . . . . . . . . . . . . . . . . . 32916.4.3 Simplify creation of an extension module . . . . . . . . . . . 33116.4.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33216.5 Pyrex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33216.5.1 Pyrex-add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33316.5.2 Pyrex-filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33516.5.3 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33616.6 ctypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33716.6.1 Having a shared library . . . . . . . . . . . . . . . . . . . . . 33816.6.2 Loading the shared library. . . . . . . . . . . . . . . . . . . 33916.6.3 Converting arguments . . . . . . . . . . . . . . . . . . . . . . 34016.6.4 Calling the function . . . . . . .

Contents I NumPy from Python 12 1 Origins of NumPy 13 2 Object Essentials 18 2.1 Data-Type Descripto

Related Documents:

y. A. rrAy. NumPy arrays are used to store lists of numerical data, vectors and matrices. The NumPy library has a large set of routines (built-in functions) for creating, manipulating, and transforming NumPy arrays. Python language also has an array data structure, but it is not as versatile, efficient and useful as the NumPy array. The NumPy

Some Linux distributions have different NumPy packages for Python 2.x and Python 3.x. In Ubuntu and Debian, install numpy at the system level using the APT package manager: sudo apt-get install python-numpy sudo apt-get install python3-numpy For other distributions, use their package managers, like zypper (Suse), yum (Fedora) etc.

NumPy User Guide, Release 1.18.4 This guide is intended as an introductory overview of NumPy and explains how to install and make use of the most important features of NumPy. For detailed reference documentation of the functions and classes contained in the package, see the reference. CONTENTS 1

NUMPY FOR MATHEMATICAL COMPUTING 5.1 Introduction to mathematical computing in Python 5.2 What are arrays and matrices? Array indexing, array math, inspecting a NumPy array, and NumPy array manipulation Hands-on Exercise: Import a NumPy module, create an array using ND-array,

example. One of my favourites from the NumPy mailing list: Date: Wed, 16 Jul 2008 16:45:37 -0500 From: Jack.Cook@ To: numpy-discussion@scipy.org Subject: Numpy Advanced Indexing Question Greetings, I have an I,J,K 3D volume of amplitude values at regularly sampled time intervals. I have an I,J 2D slice which contains a time (K)

Python Command Description np.linalg.inv Inverse of matrix (numpy as equivalent) np.linalg.eig Get eigen value (Read documentation on eigh and numpy equivalent) np.matmul Matrix multiply np.zeros Create a matrix filled with zeros (Read on np.ones) np.arange Start, stop, step size (Read on np.linspace) np.identity Create an identity matrix

SciPy and NumPy NumPy Numerical Processing Started off as numecric written in 1995 by Jim Huguni et al. Numeric was slow for large arrays and was rewritten for large arrays as Numarray Travis Oliphant, in 2005 merged them both

The SRD is the ultimate axial pile capacity that is experienced during the dynamic conditions of pile driving. Predictions of the SRD are usually calculated by modifying the calculation for the ultimate static axial pile capacity in compression. API RP 2A and ISO 19002 refer to several methods proposed in the literature.