def join_fs_jgh_list(self, fs_list, jgh_list):
     "Beide Listen müssen nicht geordnet sein."
     "Es wird eine Liste aus Paaren (fs, jgh) gebildet, mit je gleicher fall_id."
     "Enthalten ist nur die Schnittmenge zwischen beiden Listen."
     fs_dict = dict([(f['fall_fn'],f) for f in fs_list])
     jgh_dict = dict([(j['fall_fn'],j) for j in jgh_list])
     keys = sorted(jgh_dict.keys())
     res = [(fs_dict[k], jgh_dict[k]) for k in keys if fs_dict.has_key(k)]
     return res
Example #2
0
def xcountrohwerte(d_list, feldname):
    res = []
    values = [x[feldname] for x in d_list]
    werte = sorted(set(values))
    for w in werte:
        freq = values.count(w)
        a = (w, freq, ((float(freq)*100)/float(len(d_list))))
        res.append(a)
    return res