-
Notifications
You must be signed in to change notification settings - Fork 3
/
increaseprev.py
executable file
·52 lines (42 loc) · 1.78 KB
/
increaseprev.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python3
import pandas as pd
# diagnosis
# edit hiv_diagnosis_early
# Diagnosed_Early_Years + Wait_Until_Next_Diagnosis_Check must equal 1
df = pd.read_csv("src/main/resources/modules/lookup_tables/hiv_diagnosis_early.csv")
df['Diagnosed_Early_Years'] = 0.02
df['Wait_Until_Next_Diagnosis_Check'] = 0.98
df.to_csv("src/main/resources/modules/lookup_tables/hiv_diagnosis_early.csv", index=False)
print(df)
del df
# edit: hiv_diagnosis_later
# Diagnosed_Later_Years + Wait_Until_Next_Diagnosis_Check must equal 1
df = pd.read_csv("src/main/resources/modules/lookup_tables/hiv_diagnosis_later.csv")
df['Diagnosed_Later_Years'] = 0.02
df['Wait_Until_Next_Diagnosis_Check'] = 0.98
df.to_csv("src/main/resources/modules/lookup_tables/hiv_diagnosis_later.csv", index=False)
print(df)
del df
# mortality: mind the column names as they are different between files
# hiv_mortality_very_early.csv
# Death_within_six_months + Living_with_Diagnosis_Six_Months
df = pd.read_csv("src/main/resources/modules/lookup_tables/hiv_mortality_very_early.csv")
df['Death_within_six_months'] = 0.01
df['Living_with_Diagnosis_Six_Months'] = 0.99
df.to_csv("src/main/resources/modules/lookup_tables/hiv_mortality_very_early.csv", index=False)
print(df)
del df
# hiv_mortality_early.csv
df = pd.read_csv("src/main/resources/modules/lookup_tables/hiv_mortality_early.csv")
df['Death'] = 0.01
df['Living_with_Diagnosis_Early_Years'] = 0.99
df.to_csv("src/main/resources/modules/lookup_tables/hiv_mortality_early.csv", index=False)
print(df)
del df
# hiv_mortality_later.csv
df = pd.read_csv("src/main/resources/modules/lookup_tables/hiv_mortality_later.csv")
df['Death'] = 0.01
df['Living_with_Diagnosis_Later_Years'] = 0.99
df.to_csv("src/main/resources/modules/lookup_tables/hiv_mortality_later.csv", index=False)
print(df)
del df