0

I was writing python code for assignment. I have find the transpose of matrix[3x3] given by user using numpy library but the transpose function throws error and return some kind of address.

import numpy as np
from numpy import matrix, random, sqrt
from numpy.core.fromnumeric import transpose 
print("Enter the elemnt of matrix Row wise in single line seperated by space( )")
entries = list(map(int, input().split()))
arr1 = np.array(entries).reshape(3,3)
tarnspose = arr1.transpose()
determin = round(np.linalg.det(arr1),4)
print(arr1)
print('\n')
print(transpose)
print(determin)

output of the code

Ismael Padilla
  • 4,666
  • 4
  • 23
  • 33
  • 2
    There is a typing error in your code: `tarnspose = arr1.transpose()` instead of `transpose = arr1.transpose()`. So Python throws an error here: `print(transpose)`. Correcting this makes your code running :) – QuagTeX Jul 26 '21 at 13:06
  • Thank you , silly of me – Samarth Motka Jul 26 '21 at 13:49

0 Answers0