Trusted answers to developer questions

Joy Kareko

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

**Linear Algebra** is a branch of mathematics concerned with linear equations and other mathematical computations. ** Scipy** is a Python library that is useful for such mathematical and scientific computations.

The ** expm()** function computes and returns the exponential of a matrix.

```
scipy.linalg.expm(A)
```

`A`

: This is the matrix whose exponential we want to obtainin.

The function returns the exponential of the matrix `A`

.

import scipyimport numpy as npfrom scipy.linalg import expmA = np.matrix([[0.234,0.567], [1.249,2.367]])print(A)B = expm(A)print('-------------------')print(B)

Run to see the results! Try changing input arguments to experiment further.

- Lines 1–4: We import the packages
`numpy`

,`scipy`

, and`expm`

. - Line 6: We declare a matrix
`A`

. - Line 10: We compute the exponential of matrix
`A`

. - Lines 8 and 14: We print the resulting matrices.

RELATED TAGS

linear algebra

python

communitycreator

CONTRIBUTOR

Joy Kareko

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring

Related Courses