Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
NumPY01
#python 3.6.9 """ /* --------------------------------------------------------------------------- * * FUNCION: Ejemplo de acceso a archivos de texto lineal secuencial con datos simples y registros * * MODIF.: Creacion (Romel) 1-Ene-2019 * * --------------------------------------------------------------------------- */ """ import numpy as np class Principal: def Trabaja(self): A = np.mat( [ [1,2], [3, 4] ] ) B = np.mat( [ [1,2,3], [4,5,6], [7,8,9] ] ) D = [ [1, 2 ], [3,4] ] self.PrintMatriz(D) E = self.CreaMatriz(2,3) self.PrintMatriz(E) def PrintMatriz(self, C): str2="" for j in range(len(C)): for k in range( len(C[j]) ): str2 += str(C[j][k]) + "," str2 += "\n" str2 += "\n" print(str2) def CreaMatriz(self, rows, cols): C = [ [0 for y in range(cols) ] for x in range(rows)] str2= "" i= 1 for j in range(rows): for k in range(cols): C[j][k] = i i += 1 return C if __name__ == "__main__": obj = Principal() # crea un objeto y se deja en un nombre de Var. obj.Trabaja() # objeto y la invocacion del metodo Principal().Trabaja() # crea objeto anonimo y ejecuta un metodo
run
|
edit
|
history
|
help
0
Rishika
Itc
calcultion
string without space into list
one
Owl
prog1.py
Submission.py
check the browser existence one by one
Юра и заселение