Académique Documents
Professionnel Documents
Culture Documents
Lecture
Today were going to talk about python modules that extend its standard numerical computing
abilities.
vector:
matrix:
tensor:
[1, 2, 3]
[[1, 2, 3],
[4, 5, 6]]
[[[1, 2, 3], [4, 5, 6]],
[[1, 2, 3], [4, 5, 6]]]
vector:
matrix:
tensor:
[1, 2, 3]
[[1, 2, 3],
[4, 5, 6]]
[[[1, 2, 3], [4, 5, 6]],
[[1, 2, 3], [4, 5, 6]]]
...but why would we want our data in an array, rather than something else?
dot(a, b)
Matrix product of a and b
More in the linalg submodule...
Random numbers
Random numbers
Two solutions:
>>> import random
>>> import numpy.random
Random numbers
Two solutions:
>>> import random
Random numbers
Two solutions:
>>> import random
Random numbers
Two solutions:
Random numbers
Two solutions:
Random numbers
Matrix multiplication is
included in the NumPy module
import xlrd
http://www.python-excel.org/
ambertk$
ambertk$
ambertk$
ambertk$
cd Desktop
gunzip xlrd-0.7.1.tar.gz
tar -xvf xlrd-0.7.1.tar
python xlrd-0.7.1/setup.py install
import xlrd
http://www.python-excel.org/
Lets say we
needed to
work with
an .xls
spreadsheet
like this
one...
Tuesday, October 20, 2009
import xlrd
xlrd example
http://www.python-excel.org/
Tuesday, October 20, 2009
Scenario.
Projecting from three dimensions to two is one type of linear transformation. We can
use a 2x3 matrix P whose columns dictate where the transformed x, y, and z will be
located in two dimensions (u, v).
Kerl, 2009
Tuesday, October 20, 2009
Scenario.
Projecting from three dimensions to two is one type of linear transformation. We can
use a 2x3 matrix P whose columns dictate where the transformed x, y, and z will be
located in two dimensions (u, v).
Kerl, 2009
Tuesday, October 20, 2009
Scenario.
Kerl, 2009
Tuesday, October 20, 2009
Scenario--better code
Kerl, 2009
Tuesday, October 20, 2009
misc.