0

How do I solve the determinant of this matrix using python? there are how solve using the word x in python?

p = np.array([[x, 1],
              [1, x]])
Wenison Marrone
  • 123
  • 1
  • 1
  • 5

1 Answers1

0

The numpy.linalg.det() function calculates the determinant of the input matrix.

Example:

import numpy as np
a = np.array([[1,2], [3,4]]) 
print np.linalg.det(a)
  • Hi, there are how solve using the word x in python? – Wenison Marrone Jun 09 '20 at 16:48
  • If you want to do "symbolic computation" (rearranging symbols rather than using actual numbers) in Python, you'll want the sympy library. Try it: x = symbols(['x']) # Turnx into symbolic variable p = np.array([[x, 1], [1, x]]) – Jose Henrique Roveda Jun 09 '20 at 18:16