comparison python/safe.py @ 6:a01ff74f9fd7

fix accumulator bug in Lava.__init__
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Tue, 25 May 2021 17:20:04 -0400
parents 56508a6033a9
children 3ee329b129c6
comparison
equal deleted inserted replaced
5:672621ab4db4 6:a01ff74f9fd7
47 lava.readline() 47 lava.readline()
48 ll=self.ll={} 48 ll=self.ll={}
49 for l in lava: 49 for l in lava:
50 x=[float(i) for i in l.split('\t')[2].split(',')] 50 x=[float(i) for i in l.split('\t')[2].split(',')]
51 k=(x[0],x[2]) 51 k=(x[0],x[2])
52 kk=ll.get(k,list()) 52 kk=ll.setdefault(k,list())
53 kk.append(x) 53 kk.append(x)
54 54
55 L=Lava('lava.tsv') 55 L=Lava('lava.tsv')
56 56
57 def d(p1,p2): 57 def d(p1,p2):