<jupyter_start><jupyter_text>**Square Matrix Calculator**<jupyter_code>import numpy as np
import matplotlib.pyplot as plt

# inputing matrix
def omat(n):  
  print("Enter the entries of the matrix.")
  for i in range(n):
    inp = []
    for j in range(n):
      inp.append(int(input()))
    omatrix.append(inp)
  print("Here is your matrix:")
  print(np.matrix(omatrix))
  plt.imshow(omatrix)
  plt.colorbar()
  plt.show()

#transpose
def tpose(): 
  tmatrix = np.transpose(omatrix)
  print("Here is your matrix transposed: \n{}".format(np.matrix(tmatrix)))
  plt.imshow(tmatrix)
  plt.colorbar()
  plt.show()

#determinant
def detm():
  det = round(np.linalg.det(omatrix), ndigits=4)
  print("The determinant is: {}".format(det))

#inverse
def invm():
  if (detm != 0):
    imatrix = np.linalg.inv(omatrix)
    print("The inverse of your matrix is: {}".format(np.matrix(imatrix)))
    plt.imshow(imatrix)
    plt.colorbar()
    plt.show()
  else:
    print("The matrix is uninvertible")

#eigenvalues
def ev():
  va,ve = np.linalg.eig(omatrix)
  print('The eigenvalues are {}'.format(va))
  print('The eigenvectors are {}'.format(ve))
  plt.imshow(ve)
  plt.colorbar()
  plt.show()

#usecase
def usecase():
  print("Enter what you would like to do with the matrix:")
  #print("A) Transpose\nB) Determinant\nC) Inverse\nD) Eigenvalues\n")
  uc = str(input("A) Transpose\nB) Determinant\nC) Inverse\nD) Eigenvalues\n"))
  if (uc == 'a') or (uc == 'A'):
    tpose()
  elif (uc == 'b') or (uc == 'B'):
    detm()
  elif (uc == 'c') or (uc == 'C'):
    invm()
  elif (uc == 'd') or (uc == 'D'):
    ev()
  else:
    print("Invalid option")

# initializing matrix
size = int(input("Enter how many rows/columns are in the square matrix:"))
omatrix = []
omat(size)
usecase()<jupyter_output>Enter how many rows/columns are in the square matrix:2
Enter the entries of the matrix.
1
2
3
4
Here is your matrix:
[[1 2]
 [3 4]]
{'fraction_non_alphanumeric': 0.16762402088772846, 'fraction_numerical': 0.005744125326370757, 'mean_word_length': 3.850632911392405, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '652144', 'license': 'MIT', 'n_tokens_mistral': 751, 'n_tokens_neox': 727, 'n_words': 198, 'path': 'python_mini_project.ipynb', 'repo_name': 'matviyz/SquareMatrixCalculator', 'size': '1915'}