Commit 40979a76 authored by justus.taeger's avatar justus.taeger
Browse files

alpha

parent fa83a14c
Patient_Id,City,Doctor
0,Elmshorn,Dr. Sommer
1,London,Dr. Bleimehl
2,Shanghai,Dr. Sommer
3,Berlin,Dr.Jarasch
4,Elmshorn,Dr.Täger
5,Shanghai,Dr. Bleimehl
6,London,Dr. Sommer
7,Boston,Dr. Bleimehl
8,Tokyo,Dr. Bleimehl
9,Paris,Dr.Täger
10,Shanghai,Dr. Bleimehl
11,Paris,Dr. Bleimehl
12,Boston,Dr. Bleimehl
13,Tokyo,Dr. Sommer
14,London,Dr. Sommer
15,Munich,Dr. Bleimehl
16,London,Dr. Sommer
17,Tokyo,Dr. Bleimehl
18,Boston,Dr. Bleimehl
19,London,Dr. Sommer
20,Berlin,Dr.Jarasch
21,Munich,Dr. Sommer
22,Shanghai,Dr.Täger
23,Paris,Dr.Täger
24,New York,Dr. Bleimehl
25,New York,Dr.Jarasch
26,Paris,Dr. Bleimehl
27,New York,Dr.Täger
28,New York,Dr. Sommer
29,Boston,Dr. Bleimehl
30,New York,Dr.Jarasch
31,Paris,Dr. Sommer
32,Tokyo,Dr. Sommer
33,Paris,Dr.Jarasch
34,Boston,Dr.Jarasch
35,Paris,Dr.Täger
36,New York,Dr.Täger
37,Munich,Dr.Täger
38,London,Dr. Bleimehl
39,London,Dr. Bleimehl
40,Berlin,Dr. Bleimehl
41,Munich,Dr.Jarasch
42,London,Dr. Bleimehl
43,Boston,Dr. Sommer
44,Munich,Dr.Jarasch
45,Berlin,Dr.Jarasch
46,Tokyo,Dr.Jarasch
47,London,Dr.Täger
48,Tokyo,Dr. Bleimehl
49,Elmshorn,Dr. Bleimehl
50,Berlin,Dr. Bleimehl
51,Munich,Dr.Täger
52,Tokyo,Dr.Jarasch
53,New York,Dr.Täger
54,Berlin,Dr.Täger
55,Munich,Dr. Bleimehl
56,Tokyo,Dr.Täger
57,Paris,Dr. Sommer
58,Tokyo,Dr. Sommer
59,Shanghai,Dr. Bleimehl
60,London,Dr.Täger
61,Shanghai,Dr.Täger
62,London,Dr. Bleimehl
63,Munich,Dr.Jarasch
64,London,Dr. Sommer
65,Paris,Dr. Bleimehl
66,Tokyo,Dr. Bleimehl
67,Elmshorn,Dr. Bleimehl
68,Paris,Dr.Täger
69,London,Dr. Sommer
70,New York,Dr. Bleimehl
71,Elmshorn,Dr. Bleimehl
72,London,Dr.Täger
73,London,Dr. Sommer
74,Shanghai,Dr.Täger
75,Tokyo,Dr. Bleimehl
76,Paris,Dr. Sommer
77,New York,Dr. Bleimehl
78,Elmshorn,Dr.Täger
79,Paris,Dr. Bleimehl
80,Boston,Dr. Bleimehl
81,Boston,Dr.Täger
82,Paris,Dr. Sommer
83,Berlin,Dr.Jarasch
84,Boston,Dr.Jarasch
85,Boston,Dr. Bleimehl
86,Munich,Dr. Sommer
87,Berlin,Dr.Täger
88,Berlin,Dr. Bleimehl
89,Shanghai,Dr.Jarasch
90,New York,Dr. Sommer
91,Tokyo,Dr. Sommer
92,New York,Dr.Jarasch
93,Elmshorn,Dr. Sommer
94,New York,Dr. Bleimehl
95,Shanghai,Dr. Sommer
96,Shanghai,Dr. Bleimehl
97,Berlin,Dr. Sommer
98,New York,Dr.Täger
99,Shanghai,Dr.Täger
100,London,Dr.Täger
101,Shanghai,Dr.Jarasch
102,New York,Dr.Täger
103,Paris,Dr.Jarasch
104,Paris,Dr. Bleimehl
105,Tokyo,Dr.Täger
106,New York,Dr.Jarasch
107,London,Dr.Täger
108,Tokyo,Dr.Täger
109,Shanghai,Dr.Täger
110,New York,Dr.Jarasch
111,Elmshorn,Dr.Jarasch
112,Paris,Dr.Jarasch
113,Elmshorn,Dr.Täger
114,Boston,Dr.Jarasch
115,Munich,Dr.Jarasch
116,Boston,Dr.Jarasch
117,London,Dr. Bleimehl
118,Munich,Dr.Täger
119,Boston,Dr.Jarasch
120,Tokyo,Dr. Bleimehl
121,Paris,Dr. Bleimehl
122,Elmshorn,Dr. Bleimehl
123,London,Dr.Jarasch
124,Shanghai,Dr.Jarasch
125,Shanghai,Dr.Täger
126,Munich,Dr. Bleimehl
127,Boston,Dr. Bleimehl
128,Elmshorn,Dr.Täger
129,New York,Dr. Sommer
130,Tokyo,Dr.Täger
131,Munich,Dr. Bleimehl
132,Elmshorn,Dr.Jarasch
133,Berlin,Dr. Sommer
134,Munich,Dr. Sommer
135,Shanghai,Dr. Bleimehl
136,Elmshorn,Dr. Bleimehl
137,Tokyo,Dr.Täger
138,Berlin,Dr. Sommer
139,Berlin,Dr. Sommer
140,Paris,Dr. Sommer
141,Boston,Dr.Jarasch
142,Paris,Dr.Jarasch
143,Tokyo,Dr.Jarasch
144,Boston,Dr.Jarasch
145,Tokyo,Dr. Sommer
146,Elmshorn,Dr.Jarasch
147,Tokyo,Dr. Sommer
148,London,Dr. Bleimehl
149,Elmshorn,Dr. Sommer
Pneumonia,Asthma,Alzheimer,Stroke,Cancer,Tubercolosis,Diagnose_ID
0,0,0,0,0,0,0
0,0,0,0,0,1,1
0,0,0,0,1,0,2
0,0,0,0,1,1,3
0,0,0,1,0,0,4
0,0,0,1,0,1,5
0,0,0,1,1,0,6
0,0,0,1,1,1,7
0,0,1,0,0,0,8
0,0,1,0,0,1,9
0,0,1,0,1,0,10
0,0,1,0,1,1,11
0,0,1,1,0,0,12
0,0,1,1,0,1,13
0,0,1,1,1,0,14
0,0,1,1,1,1,15
0,1,0,0,0,0,16
0,1,0,0,0,1,17
0,1,0,0,1,0,18
0,1,0,0,1,1,19
0,1,0,1,0,0,20
0,1,0,1,0,1,21
0,1,0,1,1,0,22
0,1,0,1,1,1,23
0,1,1,0,0,0,24
0,1,1,0,0,1,25
0,1,1,0,1,0,26
0,1,1,0,1,1,27
0,1,1,1,0,0,28
0,1,1,1,0,1,29
0,1,1,1,1,0,30
0,1,1,1,1,1,31
1,0,0,0,0,0,32
1,0,0,0,0,1,33
1,0,0,0,1,0,34
1,0,0,0,1,1,35
1,0,0,1,0,0,36
1,0,0,1,0,1,37
1,0,0,1,1,0,38
1,0,0,1,1,1,39
1,0,1,0,0,0,40
1,0,1,0,0,1,41
1,0,1,0,1,0,42
1,0,1,0,1,1,43
1,0,1,1,0,0,44
1,0,1,1,0,1,45
1,0,1,1,1,0,46
1,0,1,1,1,1,47
1,1,0,0,0,0,48
1,1,0,0,0,1,49
1,1,0,0,1,0,50
1,1,0,0,1,1,51
1,1,0,1,0,0,52
1,1,0,1,0,1,53
1,1,0,1,1,0,54
1,1,0,1,1,1,55
1,1,1,0,0,0,56
1,1,1,0,0,1,57
1,1,1,0,1,0,58
1,1,1,0,1,1,59
1,1,1,1,0,0,60
1,1,1,1,0,1,61
1,1,1,1,1,0,62
1,1,1,1,1,1,63
%% Cell type:code id: tags:
```
import random
import csv
diseases = ['Cancer', 'Diabetes', 'Heart Disease', 'Stroke', 'Alzheimer', 'Influenca', 'Syphilis', 'Pneumonia', 'Asthma', 'Tubercolosis']
diseases_selection = []
number_of_diseases = input("Anzahl an Krankheiten (bitte 1 bis 10 eingeben): ")
number_of_patients = input("Anzahl an Patienten: ")
number_of_patients = int(number_of_patients)
number_of_diseases = int(number_of_diseases)
for i in range(number_of_diseases):
tmp = random.choice(diseases)
diseases_selection.append(tmp)
diseases.remove(tmp)
disease_csv = []
disease_csv.append(diseases_selection)
import itertools
tmp_list = []
counter = -1
for i in range(len(diseases_selection)):
tmp_list.append([0,1])
for element in itertools.product(*tmp_list):
counter += 1
element = list(element)
element.append(counter)
disease_csv.append(element)
diseases_selection.append('Diagnose_ID')
with open('disease.csv', 'w', newline='') as file:
writer = csv.writer(file)
writer.writerows(disease_csv)
patients = []
patient_header = ['Patient_Id', 'Age', 'Height', 'Weight', 'BMI', 'Gender', 'Diagnose_ID']
gender = ['f', 'm', 'div']
diganose_IDs = []
for i in range(len(disease_csv)-1):
diganose_IDs.append(i)
patients.append(patient_header)
for i in range(number_of_patients):
patient = []
patient.append(i)
patient.append(random.randint(10,80))
height = random.randint(150,200)
patient.append(height)
weight = random.randint(45,120)
patient.append(weight)
patient.append(weight / (height/100)**2)
patient.append(random.choice(gender))
patient.append(random.choice(diganose_IDs))
patients.append(patient)
with open('patient.csv', 'w', newline='') as file:
writer = csv.writer(file)
writer.writerows(patients)
cities = ['Munich', 'London', 'Tokyo', 'Shanghai', 'Berlin', 'New York', 'Boston', 'Paris', 'Elmshorn']
doctors = ['Dr. Sommer', 'Dr. Bleimehl', 'Dr. Jarasch', 'Dr. Täger']
city_doctor_csv = []
city_doctor_csv_header = ['Patient_Id', 'City', 'Doctor']
city_doctor_csv.append(city_doctor_csv_header)
for i in range(len(patients)-1):
city_doctor = []
city_doctor.append(i)
city_doctor.append(random.choice(cities))
city_doctor.append(random.choice(doctors))
city_doctor_csv.append(city_doctor)
with open('city_doctor.csv', 'w', newline='') as file:
writer = csv.writer(file)
writer.writerows(city_doctor_csv)
```
Patient_Id,Age,Height,Weight,BMI,Gender,Diagnose_ID
0,73,200,87,21.75,m,60
1,57,183,98,29.26334020126011,m,25
2,16,153,65,27.76709812465291,f,45
3,57,153,82,35.02926224956214,m,3
4,32,181,101,30.829339763743477,f,43
5,51,154,49,20.66115702479339,m,42
6,75,187,84,24.021275987303035,m,54
7,57,195,71,18.671926364234057,f,49
8,58,169,63,22.058051188683873,div,45
9,41,187,64,18.301924561754696,m,14
10,66,195,111,29.19132149901381,f,39
11,28,157,110,44.62655685829039,f,53
12,53,194,99,26.304601976830696,f,57
13,30,197,106,27.31325208070293,f,60
14,24,198,102,26.017753290480563,f,32
15,77,178,58,18.30576947355132,m,3
16,15,198,93,23.72206917661463,div,10
17,59,170,76,26.29757785467128,div,49
18,36,186,64,18.499248468030984,div,24
19,57,174,108,35.6718192627824,f,52
20,76,170,116,40.13840830449828,f,54
21,66,198,103,26.272829303132333,div,19
22,77,187,89,25.45111384369012,div,45
23,10,152,118,51.07340720221607,m,52
24,74,178,107,33.77098851155157,f,21
25,19,172,116,39.21038399134668,div,3
26,72,162,97,36.96082914189909,m,61
27,28,194,100,26.570305027101714,m,48
28,60,183,89,26.575890590940304,m,15
29,57,160,87,33.98437499999999,m,51
30,35,199,99,24.999368702810536,div,20
31,63,155,103,42.872008324661806,m,13
32,14,180,50,15.432098765432098,div,51
33,68,167,79,28.326580372189753,m,34
34,61,200,58,14.5,m,33
35,47,165,120,44.0771349862259,m,25
36,58,173,74,24.725182932941294,m,33
37,16,160,61,23.828124999999996,m,39
38,25,154,100,42.165626581211,div,63
39,58,158,50,20.028841531805796,m,48
40,64,163,71,26.722872520606725,div,20
41,64,178,107,33.77098851155157,m,14
42,59,177,73,23.301094832264035,m,55
43,25,194,46,12.222340312466788,div,38
44,31,195,45,11.834319526627219,f,37
45,67,150,51,22.666666666666668,m,60
46,49,173,76,25.393431120318084,f,8
47,63,160,96,37.49999999999999,m,22
48,23,162,105,40.009144947416544,f,30
49,19,179,54,16.853406572828565,m,55
50,58,170,116,40.13840830449828,m,15
51,26,174,113,37.323292376800104,m,21
52,34,194,52,13.81655861409289,div,39
53,29,163,49,18.442545824080696,m,24
54,20,165,76,27.915518824609737,m,17
55,50,162,76,28.959000152415786,f,44
56,38,162,97,36.96082914189909,f,61
57,60,186,77,22.25690831309978,f,36
58,57,190,116,32.13296398891967,m,28
59,77,156,46,18.902038132807363,f,58
60,60,178,119,37.558389092286326,div,6
61,77,180,91,28.086419753086417,m,54
62,36,160,81,31.640624999999993,div,17
63,39,170,48,16.60899653979239,div,34
64,47,186,46,13.29633483639727,f,10
65,76,174,79,26.09327520147972,f,23
66,18,165,73,26.813590449954088,f,14
67,61,169,91,31.861629494765594,div,18
68,59,175,83,27.102040816326532,f,29
69,27,177,50,15.959653994701394,m,9
70,61,170,107,37.024221453287204,div,19
71,60,173,100,33.41240936883958,f,19
72,11,162,93,35.43667123914037,f,9
73,30,195,94,24.720578566732414,div,41
74,78,192,72,19.53125,m,34
75,40,166,78,28.305995064595734,m,25
76,18,155,71,29.552549427679498,f,16
77,54,179,115,35.89151399769046,f,4
78,13,172,63,21.29529475392104,m,21
79,41,181,99,30.218857788223804,m,1
80,61,185,56,16.362308254200144,m,1
81,27,177,85,27.13141179099237,f,26
82,24,159,89,35.20430362722993,m,8
83,69,183,97,28.964734689002356,m,60
84,29,158,99,39.65710623297548,div,39
85,10,182,67,20.227025721531216,f,33
86,48,188,64,18.107741059302853,f,13
87,31,200,45,11.25,div,34
88,79,179,80,24.968009737523797,m,14
89,46,199,48,12.12090603772632,div,46
90,47,195,51,13.412228796844182,m,48
91,22,152,119,51.50623268698061,f,1
92,45,193,70,18.792450804048432,f,10
93,25,174,103,34.020346148764695,f,51
94,13,161,50,19.28937926777516,m,57
95,24,159,49,19.382144693643447,f,54
96,45,186,100,28.905075731298414,f,28
97,26,196,54,14.056643065389423,div,19
98,78,196,61,15.878800499791755,f,24
99,16,194,50,13.285152513550857,m,3
100,53,153,74,31.611773249604852,m,48
101,17,150,64,28.444444444444443,m,7
102,35,163,59,22.20633068613798,m,27
103,65,186,106,30.63938027517632,m,25
104,28,170,86,29.75778546712803,m,14
105,37,165,70,25.71166207529844,f,34
106,21,153,71,30.33021487462087,div,27
107,48,157,55,22.313278429145196,div,1
108,48,198,80,20.40608101214162,m,8
109,28,175,72,23.510204081632654,f,44
110,56,168,117,41.454081632653065,f,55
111,36,181,114,34.79747260462135,f,28
112,37,168,60,21.258503401360546,f,6
113,55,157,57,23.124670372023203,div,29
114,55,167,74,26.533758829646096,div,1
115,14,187,79,22.59143813091595,div,37
116,32,170,50,17.301038062283737,f,28
117,33,152,111,48.04362880886426,div,15
118,49,161,106,40.893484047683344,f,57
119,51,160,96,37.49999999999999,f,60
120,60,173,99,33.07828527515119,f,59
121,38,166,54,19.5964581216432,f,46
122,80,164,86,31.975014872099948,div,46
123,52,187,96,27.45288684263204,div,32
124,27,172,63,21.29529475392104,div,44
125,72,157,49,19.879102600511175,m,34
126,11,181,93,28.387411861664784,f,44
127,71,184,112,33.0812854442344,div,49
128,21,175,105,34.285714285714285,m,28
129,77,158,88,35.250761095978206,m,30
130,40,167,60,21.513858510523864,m,3
131,54,194,105,27.8988202784568,div,41
132,36,166,48,17.419073885905068,f,41
133,66,150,105,46.666666666666664,m,27
134,51,154,55,23.19109461966605,div,37
135,29,189,67,18.75647378292881,m,49
136,43,164,64,23.795359904818564,div,49
137,57,154,57,24.034407151290267,div,12
138,16,162,78,29.721079103795148,div,2
139,72,198,45,11.47842056932966,m,8
140,13,172,94,31.77393185505679,f,6
141,55,164,107,39.782867340868535,m,45
142,42,166,55,19.959355494266223,div,19
143,17,169,66,23.1084345786212,f,7
144,30,177,74,23.620287912158062,f,4
145,46,177,83,26.493025631204315,f,4
146,56,168,68,24.092970521541954,f,23
147,35,180,62,19.1358024691358,m,26
148,41,198,105,26.782981328435874,m,1
149,61,194,118,31.35295993198002,f,60
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment