Exercises

Ex. 1 → Consider a 4 × 3 matrix M:

Exercises

  1. Construct this matrix in Python using the function array .
  2. Construct the same matrix using the function arange  followed by a suitable reshape.
  3. What is the result of the expression M[2,:] ? What is the result of the similar expression M[2:]?

Ex. 2 → Given a vector x, construct in Python the following matrix:

                 

Exercises

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.