Trace the inversion

Report a typo

In the topic, we mentioned that SciPy and NumPy have some functions in common. The goal of this problem is to illustrate that in some cases, those libraries are interchangeable.
Given a matrix A=(1223)A = \begin{pmatrix} 1 & 2\\ 2 & 3 \end{pmatrix}, use SciPy or NumPy to find the inverse of the matrix AA, then calculate and print the trace of the inverted matrix.

Tip: You can use numpy.trace or scipy.trace to get the trace of a matrix. To find the inverse, use inv function from the linalg subpackage.

Write a program in Python 3
import numpy

A = numpy.array([[1, 2], [2, 3]])

# your code
___

Create a free account to access the full topic