Introduction to NumPy
Maryam Tavakol
Machine Learning Group
1
Winter semester 2016/17
Introduction to NumPy Maryam Tavakol Machine Learning Group Winter - - PowerPoint PPT Presentation
Introduction to NumPy Maryam Tavakol Machine Learning Group Winter semester 2016/17 1 What is NumPy? Short for Numerical Python Wikipedia : NumPy is an extension to the Python programming language, adding support for large,
Maryam Tavakol
Machine Learning Group
1
Winter semester 2016/17
programming language, adding support for large, multi-dimensional arrays and matrices, along with a large library of high-level mathematical functions to
2
ndarray
computations with arrays or mathematical
to disk
3
random number generation
Fortran code to Python
4
and cleaning, subsetting and filtering, transformation, and any other kinds of computations
set operations
summarizing data
5
for merging and joining together heterogeneous data sets
instead of loops with if-elif-else branches
transformation, function application)
6
homogeneous data.
execute in compiled code for performance
7
array function
8
will be converted into a multidimensional array
9
10
an array of all zeros
11
12
13
14
containing the information the ndarray needs to interpret
15
16
17
another using ndarray’s astype method
18
19
arrays applies the operation element-wise
20
expect, propagating the value to each element
21
22
23
24
25
26
27
28
“Bob”
29
30
31
similarly returns a view on the underlying data without copying anything: arr.T
32
very often, like for example computing the inner matrix product using np.dot
33
34
array as the result
35
36
37
38
39
concise array expressions rather than writing loops
40
41
42
43
determinants, and other square matrix math
44
45