Exercises
Ex. 1 → Consider a 4 × 3 matrix M:
- Construct this matrix in Python using the function
array
. - Construct the same matrix using the function
arange
followed by a suitable reshape. - What is the result of the expression
M[2,:]
? What is the result of the similar expressionM[2:]
?
Ex. 2 → Given a vector x, construct in Python the following matrix:
Here, xi are the components of the vector x (numbered from zero). Given a vector y, solve in Python the linear equation system Va = y. Let the components of a be denoted by ai, i = ...
Get Scientific Computing with Python 3 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.