-
Notifications
You must be signed in to change notification settings - Fork 0
/
test4
205 lines (162 loc) · 5.77 KB
/
test4
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
grades = [8, 9, 10, 11]
#txt_file = open("results.txt", "a")
filename1 = "surveys.csv"
filename2 = "(10) Politische Bildung.csv"
surveys_df = pd.read_csv(filename2)
# for i in grades:
# txt_file = open("results.txt", "a")
# txt_file.write("\nStufe"+str(i)+":")
# survey_df = pd.read_csv("("+str(i)+") "+"Politische Bildung.csv")
# txt_file.write(str(survey_df.describe()))
# txt_file.close()
#print(surveys_df.columns)
columns = []
for i in surveys_df.columns:
columns.append(i)
#print(columns)
# print(columns)
# surveys_df.boxplot(column = [
# # "time",
# # "sex",
# "I int pol",
# "i think surrounding",
# "i int elec",
# "i int gov",
# "i int news",
# "th pol act + inf",
# "th let pol",
# "elec tom",
# ])
# #surveys_df.plot()
# plt.show()
# for i in grades:
# print("\nStufe"+str(i)+":")
# survey_df = pd.read_csv("("+str(i)+") "+"Politische Bildung.csv")
# survey_df.boxplot(column = [
# # "time",
# # "sex",
# "I int pol",
# "i think surrounding",
# "i int elec",
# "i int gov",
# "i int news",
# "th pol act + inf",
# "th let pol",
# "elec tom",
# ])
# #surveys_df.plot()
# plt.show()
interest_list = []
for i, j in surveys_df.iterrows():
# print("\nparticipant", i+1, ":")
individual_responses = []
for n in range(24):
#print(j[2+n])
individual_responses.append(j[n+2]) #skips first 2 (irrelevant) columns
# print(individual_responses)
interest_list.append(individual_responses)
# print(surveys_df.shape[0])
# print(surveys_df.shape[1])
# print("\nTotal: ", interest_list)
# print((interest_list[22][1]))
# print((interest_list[22][22]))
# print(surveys_df.iloc[22,25])
# print(surveys_df.shape[1])
# for i in range(5):
# print(i+2)
# for i in interest_list:
# for j in len():
# print(i[j])
# n = 1
# for i in interest_list:
# print("\nParticipant", n,":")
# n += 1
# for j in range(23):
# print(i[j])
participants_resp_edu = []
n = 0
for i in interest_list:
# print("\nParticipant", str(n+1),":")
individual_response = []
#Q1
if "Jeder volljährige Bürger mit einer deutschen Staatsbürgerschaft" in (interest_list[n][8]):
individual_response.append(1)
#Q2
if "Der Bundespräsident" in (interest_list[n][9]):
individual_response.append(2)
#Q3
if "4 Jahre" in (interest_list[n][10]):
individual_response.append(1)
#Q4
if "Bundespräsident" in (interest_list[n][11]):
individual_response.append(1)
if "Bundesverfassungsgericht" in (interest_list[n][11]):
individual_response.append(1)
if "Bundeskanzler" in (interest_list[n][11]):
individual_response.append(1)
if "Bundesversammlung" in (interest_list[n][11]):
individual_response.append(1)
if "Bundestag" in (interest_list[n][11]):
individual_response.append(1)
#Q5
if(interest_list[n][12]) == "Sie ernennen die Kabinettsmitglieder des Bundsrates":
individual_response.append(3)
#Q6
if(interest_list[n][13]) == "Zur Hälfte vom Bundesrat und zur anderen Hälfte vom Bundestag, jeweils mit 2/3 Mehrheit, auf 12 Jahre":
individual_response.append(5)
#Q7
if(interest_list[n][14]) == "Angela Merkel":
individual_response.append(1)
#Q8
if(interest_list[n][15]) == "Die Bundesversammlung":
individual_response.append(2)
#Q9
if(interest_list[n][16]) == "Der Bundestag":
individual_response.append(2)
#Q10
if(interest_list[n][17]) == "Frank-Walter Steinmeier":
individual_response.append(1)
#Q11
if "Ernennt/ Entlässt Richter des Bundesverfassungsgerichts" in (interest_list[n][18]):
individual_response.append(1)
if "Ernennt den Bundeskanzler" in (interest_list[n][18]):
individual_response.append(1)
if "Fertigt Gesetze aus" in (interest_list[n][18]):
individual_response.append(1)
if "Löst den Bundestag auf" in (interest_list[n][18]):
individual_response.append(1)
# #Q12
if "Höchstes Gericht in Deutschland" in (interest_list[n][19]):
individual_response.append(1)
if "Prüft Gesetze auf potentielle Verfassungswidrigkeit" in (interest_list[n][19]):
individual_response.append(1)
if "Maßstab bei der Rechtssprechung ist das Grundgesetz" in (interest_list[n][19]):
individual_response.append(1)
#Q13
if "Gegenzeichnung von Gesetzen" in (interest_list[n][20]):
individual_response.append(1)
if "Vorsitz der Bundesregierung" in (interest_list[n][20]):
individual_response.append(1)
#Q14
if "Gesetzesinitative" in (interest_list[n][21]):
individual_response.append(1)
if "Entscheidung über Bundeshaushalt" in (interest_list[n][21]):
individual_response.append(1)
if "Kontrolle der Regierung" in (interest_list[n][21]):
individual_response.append(1)
if "Wahl des Bundeskanzlers" in (interest_list[n][21]):
individual_response.append(1)
#Q15
if "Gesetzesinitiative" in (interest_list[n][22]):
individual_response.append(1)
if "Mitwirken in auswärtigen Angelegenheiten" in (interest_list[n][22]):
individual_response.append(1)
#Q16
if(interest_list[n][23]) == "Kanzler,- Kollegial,- Ressortprinzip":
individual_response.append(8)
n += 1
participants_resp_edu.append(individual_response)
print(individual_response)