human
I am working on the file "Alumnos/JuanPabloDeBotton/Tarea1_JuanPabloDeBotton.ipynb".
The first task is:
Ejercicios
Can you write Python program for it?
assistant
#Here is the Python program you requested.

class Array:
    "Una clase minima para algebra lineal"    
    def __init__(self, list_of_rows): 
        "Constructor y validador"
        # obtener dimensiones
        self.data = list_of_rows
        nrow = len(list_of_rows)
        #  ___caso vector: redimensionar correctamente
        if not isinstance(list_of_rows[0], list):
            nrow = 1
            self.data = [[x] for x in list_of_rows]
        # ahora las columnas deben estar bien aunque sea un vector
        ncol = len(self.data[0])
        self.shape = (nrow, ncol)
        # validar tamano correcto de filas
        if any([len(r) != ncol for r in self.data]):
            raise Exception("Las filas deben ser del mismo tamano")
                    
    # Ejercicio 1
    def __repr__(self):
        str2print = "Array"   
        for i in range(len(self.data)):
            if(i==0):
                str2print += str(self.data[i]) + "\n"
            if(i>0):
                str2print += "     " + str(self.data[i]) + "\n" 
        return str2print
    
    def __str__(self):
        str2print = ""   
        for i in range(len(self.data)):
            str2print += str(self.data[i]) + "\n"
        return str2print
    
    #Ejercicio2
    def __getitem__(self, idx):
        return self.data[idx[0]][idx[1]]
    
    
    def __setitem__(self, idx, valor):
        self.data[idx[0]][idx[1]] = valor
        
    # Ejercicio 3
    def zeros(x, y):
        array_de_ceros = Array([[0 for col in range(y)] for row in range(x)])
        return array_de_ceros
        
    def eye(x):
        array_eye = Array([[0 for col in range(x)] for row in range(x)])  
        for i in range(x):
            for j in range(x):
                if i == j:
                    array_eye[i,j] = 1
        return array_eye
    
    # Ejercicio 4
    def transpose(self):
        #Obtener dimensiones
        num_row = len(self.data)
        num_col = len(self.data[0])  
        #Crear matriz receptora
        mat_transpuesta = Array([[0 for col in range(num_row)] for row in...