from analysis_script import KlinMikroTools with open("bakt.txt", "r") as file: bakt = file.readlines() bakt = [i.replace("\n", "") for i in bakt] bakt = [i.split(":") for i in bakt] run = KlinMikroTools() xl, sheetnames = run.load_excel("1518_anaerobes.xlsx") keys, allData = run.load_data_excel(xl, "an_bot_sheet", True) allAP = run.fix_AP(allData, 0, 2) newData = [] for i in allData: newData.append(i) for k in bakt: if k[0] in i[11].lower(): newData[-1].append(k[-1]) print(newData[10], bakt) run.config["OUTPUT_CSV"] = "1518_anaerobes.csv" st = run.gen_csv(newData) run.save_csv(st)
from analysis_script import KlinMikroTools run = KlinMikroTools() xl, sheetnames = run.load_excel("1518_qlikview_an.xlsx") keys, data = run.load_data_excel(xl, "Sheet1", True) AP = run.fix_AP(data, 0, 2) AP = [i[0] for i in AP] ttan = "anaerobflaska" ttae = "aerobflaska" with open("scripts\\notinaer.txt", "r") as file: baktana = file.readlines() baktana = [i.replace("\n", "") for i in baktana] with open("scripts\\caninaer.txt", "r") as file: baktaer = file.readlines() baktaer = [i.replace("\n", "") for i in baktaer] TTAN = [] TTAE = [] for i in data: try: if ttan in i[15]: for k in baktana: if k in i[11].lower(): print(True) TTAN.append(i) # elif ttae in i[15]:
from analysis_script import KlinMikroTools run = KlinMikroTools() xl, sheetnames = run.load_excel("qlikview_fryslista_union.xlsx") keys, allData = run.load_data_excel(xl, "Sheet3", True) allAP = run.fix_AP(allData, 0, 2) for sheet in sheetnames: keys, data = run.load_data_excel(xl, sheet, True) newData = [] for i in data: for ind, k in enumerate(allAP): if i[1] in k: newData.append(i) for u in allData[ind]: newData[-1].append(u) run.config["OUTPUT_CSV"] = f"{sheet}.csv" st = run.gen_csv(newData) run.save_csv(st)
from analysis_script import KlinMikroTools run = KlinMikroTools() xl, sheetnames = run.load_excel("1518_qlikview_an.xlsx") keys, data = run.load_data_excel(xl, "Sheet1", True) AP = run.fix_AP(data, 0, 2) AP = [i[0] for i in AP] xl2, sheetnames = run.load_excel("1518_qlikview_an.xlsx") keys2, data2 = run.load_data_excel(xl2, "Sheet1", True) AP2 = [i[1] for i in data2] age = [i[-3] for i in data] ankomst = [i[6] for i in data] newdict = {i:[0, []] for i in AP} for ind, i in enumerate(AP): if i in newdict: if not data[ind][11] in newdict[i][-1]: newdict[i][0] += 1 newdict[i][-1].append(data[ind][11]) n = 0 d = {} for i in newdict.keys(): if newdict[i][0] > 1: n += 1 d[i] = newdict[i]
from analysis_script import KlinMikroTools run = KlinMikroTools() AP = run.load_data_csv("Hello_searchres2.csv") AP = [i[0] for i in AP] frysfiler = [ "Fryslista_AP_2015_VO.xlsx", "Fryslista_AP_2016_VO.xlsx", "Fryslista_AP_2017_VO.xlsx", "Fryslista_AP_2018_VO.xlsx" ] offData = [] for fil in frysfiler: xl, sheetnames = run.load_excel(fil) for sheet in sheetnames: keys, data = run.load_data_excel(xl, sheet, True) for ap in AP: for u in data: for k in u: try: if ap in k: offData.append(u) except Exception as e: pass print(len(offData))