lengyijun
1/4/2019 - 11:34 AM

a.py

import csv

count_list=[]
time_list=[]
for i in range(1001):
    count_list.append(0)
assert len(count_list)==1001

#row[0] id
#row[1] time
with open("piece_128K.log") as csvfile:
    spamreader = csv.reader(csvfile, delimiter=',', quotechar='|')
    for row in spamreader:
        count_list[int(row[0])]+=1
        if count_list[int(row[0])]==32:
            time_list.append(float(row[1]))
            
print len(time_list)
#  assert len(time_list)==1000
time_list.sort()

#  for i in range(1,1001):
    #  assert count_list[i]==32


print "25%";
print time_list[250]

print "50%"
print time_list[500]

print "75%"
print time_list[750]

print "100%"
print time_list[-1]