Ejemplo n.º 1
0
def data_analysis(healthy, infected, symptomatic, cured, n):
    interval = aggregate_interval
    actual_live_infections = intervaled_data(interval, infected, symptomatic)
    print("actual_live_infections")
    cdc_new_cases = new_infections_estimate(interval, symptomatic, cured)
    print("cdc_new_cases")
    pure_rs = random_samples_by_interval(interval, healthy, infected,
                                         symptomatic, cured, n)
    print("pure_rs")
    cured_exclusion_rs = random_samples_no_cured(interval, healthy, infected,
                                                 symptomatic, n)
    print("cured_exclusion_rs")
    asymptomatic_rs = random_samples_asymptomatics(interval, healthy, infected,
                                                   symptomatic, n)
    print("asymptomatic_rs")

    wb = Workbook()
    sheet = wb.add_sheet('Analysis')

    list = [
        actual_live_infections, cdc_new_cases, pure_rs, cured_exclusion_rs,
        asymptomatic_rs
    ]

    column = -1
    wb._Workbook__worksheets = [wb._Workbook__worksheets[0]]

    sheet.write(0, 0, 'Actual Live Infections')
    sheet.write(0, 1, 'CDC New Cases')
    sheet.write(0, 2, 'Pure RS')
    sheet.write(0, 3, 'Cured Exclusion RS')
    sheet.write(0, 4, 'Asymptomatic RS')

    for i in range(len(list)):
        column += 1
        row = 1
        for z in range(len(list[i])):
            print(list[i][z])
            sheet.write(row, column, float(list[i][z]))
            row += 1

    wb.save('throwaway.xls')

    return [
        actual_live_infections, cdc_new_cases, pure_rs, cured_exclusion_rs,
        asymptomatic_rs
    ]