import yoda aName = 'output' hists = yoda.read( '%s.yoda' % aName ) tags = sorted( hists.keys() ) f = open('%s_final.yoda' % aName, 'w') for h in tags: if 'x01' not in h: continue path = h[:-5] + '%i' + h[-4:] hists[h] = yoda.Histo1D.divide(hists[ path % 2 ], hists[ path % 3 ]) hists[h].setAnnotation('Path', h) yoda.writeYODA(hists[h], f) f.close()