Tentative NumPy Tutorial
Please do not hesitate to click the edit button. You will need to create a User Account first.
目录
1. Prerequisites
2. The Basics
1. An example
2. Array Creation
3. Printing Arrays
4. Basic Operations
5. Universal Functions
6. Indexing, Slicing and Iterating
3. Shape Manipulation
1. Changing the shape of an array
2. Stacking together different arrays
3. Splitting one array into several smaller ones
4. Copies and Views
1. No Copy at All
2. View or Shallow Copy
3. Deep Copy
4. Functions and Methods Overview
5. Less Basic
1. Broadcasting rules
6. Fancy indexing and index tricks
1. Indexing with Arrays of Indices
2. Indexing with Boolean Arrays
3. The ix_() function
4. Indexing with strings
7. Linear Algebra
1. Simple Array Operations
2. The Matrix Class
3. Indexing: Comparing Matrices and 2D Arrays
8. Tricks and Tips
1. "Automatic" Reshaping
2. Vector Stacking
3. Histograms
9. References
Prerequisites
Before reading this tutorial you should know a bit of Python. If you would like to refresh your memory, take a look at the Python tutorial.
If you wish to work the examples in this tutorial, you must also have some software installed on your computer. Minimally:
Python
NumPy
These you may find useful:
ipython is an enhanced interactive Python shell which is very convenient for exploring NumPy's features
matplotlib w ill enable you to plot graphics
SciPy provides a lot of scientific routines that w ork on top of NumPy
The Basics
NumPy's main object is the homogeneous multidimensional array. It is a table of elements (usually numbers), all of the same t ype, indexed
by a tuple of positive integers. In Numpy dimensions are called axes. The number of axes is rank.
- 1
- 2
前往页