SHARE
TWEET

cod cheat codes

a guest Nov 8th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def best_n_category(movie_list, movie_key):
  2.     rand_dict = []
  3.     year = {}
  4.     thing ={}
  5.     ratings = []
  6.     rows = bucket_count(movie_list, movie_key)
  7.     thing = bucketize(movie_list, movie_key)
  8.     for key in rows:
  9.         year = key
  10.         median_rating = 0
  11.         count = 0
  12.         count = rows[key]
  13.         for i in range(count):
  14.             val = thing[key][i]["rating"]
  15.         ratings.append(val)
  16.         median_rating = statistics.median(ratings)
  17.         rand_dict.append({'category': year, 'rating': median_rating, 'count': count})
  18.         ratings.clear()
  19.     return rand_dict
  20.    
  21. def ranking(row):
  22.     return row["rating"]
  23.    
  24. best_did = best_n_category(movies, "year")
  25. best_did.sort(key=ranking, reverse=True)
  26.  
  27. best_did[:10]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top