Guest User

Untitled

a guest
Jan 16th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. None
  2. None
  3.  
  4. class RegresionLineal:
  5.  
  6. xi = 0
  7. yi = 0
  8. lista = ListaEnlazada()
  9.  
  10. def __init__(self, proxy):
  11. self.proxy = proxy
  12.  
  13. def calcularVariables(self, lista):
  14.  
  15. nodoActual = self.lista.nodoInicio
  16. while nodoActual.siguienteNodo != None:
  17. xi = nodoActual.dato1
  18. yi = nodoActual.dato2
  19.  
  20. print(nodoActual.dato1)
  21. print(nodoActual.dato2)
  22.  
  23. class LecturaArchivo:
  24.  
  25. proxy = 0.0
  26. listaEnlazada = ListaEnlazada()
  27. regresionLineal = RegresionLineal(proxy)
  28.  
  29.  
  30.  
  31. nombreArchivo = input('Nombre del archivo: ')
  32. archivo = open(nombreArchivo, "r")
  33. lineas = archivo.read()
  34. datos = lineas.split(',')
  35.  
  36. for dato in datos:
  37. xTemporal = float(datos[0])
  38. yTemporal = float(datos[1])
  39.  
  40. listaEnlazada.agregarNodoFinal((xTemporal), (yTemporal))
  41.  
  42.  
  43. regresionLineal.calcularVariables(listaEnlazada.obtenerNodos())
Add Comment
Please, Sign In to add comment