Python NumPy 1 Getting started Flashcards
What does NumPy add to Python?
The ability to work with large arrays, do computation with vectors, and do matrix algebra.
Mathematical operations can be performed on all values in a ndarray at one time rather than having to loop through values, as would be necessary with a Python list.
NumPy is very fast .
If you have the Anaconda distribution, how do you install the NumPy library?
Get into the Anaconda prompt, and type
>conda install numpy
What new object types does NumPy introduce?
ndarray = arrays = multidimensional arrays
If you want to use the NumPy library, what must you first do in your session.
Import numpy as np
What are the types operations that we will learn about arrays?
How to create an array (ndarray)
How to programatically generate sequences
How to restructure arrays
How to select sub-arrays
How to do linear algebra operations
You will be working with functions and methods. What is the difference between a function and a method?
How can you create a one-dimensional array in NumPy?
Convert a list to an array using the array function.
How do you create a 2-dimensional array?
Convert a list of lists using the array function.
How to programatically generate an array with a range of integers from 0 to N-1?
np.arange(0,11)
How to programatically generate an array of even numbers from 0 to N-1?
np.arange(0,11,2)
=np.arange(start, stop, increment)