Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub_id = [14309080, 14309081, 14309082, 14309083, 14309084, 14309085, 14309086, 14309087, 14309088, 14309089, 14309090, 14309091, 14309092, 14309093, 14309094] #, 14309095]
- cdn_id = [1408467242, 1408467242, 1408467246, 1408467254, 1408467268, 1408467282, 1408467286, 1408467291, 1408467292, 1408467302, 1408467304, 1408467319, 1408467327, 1408467332, 1408467343] #, 0]
- #sub_id = [1388580, 1388579]
- #cdn_id = [1213770987, 1213771002]
- def distance(l):
- rv = []
- for n in range(len(l)):
- if n==0:
- rv.append(0)
- else:
- rv.append(l[n] - l[n-1])
- return rv
- if __name__ == '__main__':
- print("sub_id: ", sub_id) #Submission number
- print("cdn_id: ", cdn_id) #Download number
- print("distance:", distance(cdn_id)) #Distance between consecutive download links (first is always zero)
- dif = lambda x,y: x-y
- sub_cdn_dif = list(map(dif, cdn_id, sub_id))
- cdn_dif = list(map(dif, cdn_id[-1:]*len(cdn_id), cdn_id))
- print("cdn_dif: ", cdn_dif) #Cummulative difference between download links, first is zero
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement