Advertisement
OreganoHauch

kd calculation

Jan 30th, 2021
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. def kd(kills, deaths):
  5. return kills/deaths
  6.  
  7. kills = 7295
  8. deaths = 6054
  9.  
  10. matches = 2766
  11.  
  12. kd_new_list = []
  13. new_matches = 803
  14.  
  15. x = range(0,30)
  16.  
  17. for k in x:
  18. for d in [3]:
  19. kills_new = kills + new_matches*k
  20. deaths_new = deaths + new_matches*d
  21. kd_new = kd(kills_new,deaths_new)
  22. kdtuple = (kd_new, k, d)
  23. kd_new_list.append(kdtuple)
  24.  
  25. y = [kdtuple[0] for kdtuple in kd_new_list]
  26.  
  27. dt = np.dtype("float", "int", "int")
  28. kd_array = np.array(kd_new_list,dtype=dt)
  29. print(kd_array[np.where(kd_array[:,0] > 2)])
  30.  
  31. plt.plot(x,y)
  32. plt.ylim(0,5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement