Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. import csv
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4. tab=[]
  5. tab2=[]
  6. tempTab=[]
  7. miasto=input("Podaj lotnisko: ")
  8. while miasto!="poznan" and miasto!="warszawa":
  9. miasto=input("Podaj lotnisko ponownie: ")
  10. if (miasto=='poznan'):
  11. print("Otwieram dane lotniska Poznan")
  12. with open('zad2.txt','r',newline='') as f:
  13. oldYear = f.readline().split(',')[1].split('-')[0]
  14. f.seek(0)
  15. d = csv.reader(f,delimiter=',')
  16. for i in d:
  17. currentYear = i[1].split('-')[0]
  18. if oldYear != currentYear:
  19. oldYear = currentYear
  20. tab.append(tempTab[:])
  21. del tempTab[:]
  22. tempTab.append([float(i[2]), float(i[3])])
  23. tab2.append([str(i[0]), str(i[1]), float(i[2]), float(i[3])])
  24. tab4=np.array(tab[0])
  25. tab3=np.array(tab2)
  26. a=max(tab[0])
  27. b=min(tab[0])
  28.  
  29.  
  30.  
  31. if tab4[0][0] >= tab4[0][1]:
  32. print(tab4[0][0])
  33. else:
  34. print(tab4[0][1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement