<jupyter_start><jupyter_text>Assignmnent1. Create a random array a, of shape (6x6) using randint and seed 2.2. Convert the array a, to an identity matrix I. $$I = \begin{bmatrix}    1 & 0 & 0 & 0 & 0 & 0  \\      0 & 1 & 0 & 0 & 0 & 0  \\      0 & 0 & 1 & 0 & 0 & 0  \\      0 & 0 & 0 & 1 & 0 & 0  \\      0 & 0 & 0 & 0 & 1 & 0  \\      0 & 0 & 0 & 0 & 0 & 1  \\  \end{bmatrix}$$<jupyter_code># Question 01
import numpy as np
import matplotlib.pyplot as plt

np.random.seed(2)
A = np.random.randint(0, 255, (6, 6))
print("A :\n ", A)

# Question 02
inverse_A = np.linalg.inv(A)
print("\nInverse of matrix A : \n ", inverse_A)

# Convert A to I by A * A-1
A = A @ inverse_A
A = np.round(A).astype(int)
print("\nI :\n ", A)<jupyter_output>A :
  [[168  15 237  72  22  43]
 [210  75 104   7 162 177]
 [ 95  75 213  47  63  31]
 [218 148 124 116  37 167]
 [195 102   4 170 107  51]
 [103  38 234  33  58 124]]

Inverse of matrix A : 
  [[ 7.95123333e-03  4.19991509e-03 -9.34339134e-04  1.96100012e-03
  -2.66691178e-03 -1.00628872e-02]
 [-5.49186329e-03  7.55932378e-06  1.09626666e-02  5.97698097e-03
  -3.32182147e-03 -7.53043121e-03]
 [ 6.14287358e-04 -1.17379557e-03  2.62325818e-03 -8.01201875e-04
  -8.22068385e-04  2.22381174e-03]
 [-2.14088679e-03 -6.23835322e-03 -5.13050077e-03 -2.19696163e-03
   7.89804016e-03  1.06401994e-02]
 [-4.18255457e-03  2.71646076e-03  2.88993486e-03 -6.56440328e-03
   4.60254549e-03  3.79817613e-03]
 [-3.55477452e-03 -8.86285593e-04 -7.52013315e-03  1.70651672e-03
   5.29856190e-04  9.92613729e-03]]

I :
  [[1 0 0 0 0 0]
 [0 1 0 0 0 0]
 [0 0 1 0 0 0]
 [0 0 0 1 0 0]
 [0 0 0 0 1 0]
 [0 0 0 0 0 1]]
{'fraction_non_alphanumeric': 0.15953545232273839, 'fraction_numerical': 0.3508557457212714, 'mean_word_length': 2.241584158415842, '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': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '493562', 'license': 'MIT', 'n_tokens_mistral': 1154, 'n_tokens_neox': 806, 'n_words': 219, 'path': 'assignments/essential/assignment_09.ipynb', 'repo_name': 'JinTang96/cv', 'size': '1636'}