Wahlen Kantonsresultate

Wahlen 2023

k kp p proj_sum projmin_sum projmax_sum z_sum proj_sum_sum z_sum_sum perc perc_alt
1 100 1 1991892 1991892 1991892 1993644 15993800 14593781 12.5 13.7
1 100 2 1302838 1302838 1302838 882735 15993800 14593781 8.1 6
1 100 3 3381256 3381256 3381256 2526077 15993800 14593781 21.1 17.3
1 100 4 4375043 4375043 4375043 3896541 15993800 14593781 27.4 26.7
1 100 7 454100 454100 454100 481814 15993800 14593781 2.8 3.3
1 100 9 48711 48711 48711 45271 15993800 14593781 0.3 0.3
1 100 12 155311 155311 155311 234589 15993800 14593781 1 1.6
1 100 13 1588499 1588499 1588499 2054383 15993800 14593781 9.9 14.1
1 100 14 15872 15872 15872 27242 15993800 14593781 0.1 0.2
1 100 16 237997 237997 237997 235022 15993800 14593781 1.5 1.6
1 100 31 1978066 1978066 1978066 2042336 15993800 14593781 12.4 14
1 100 35 464215 464215 464215 174127 15993800 14593781 2.9 1.2
2 100 1 652917 652917 652917 689737 8706499 8250302 7.5 8.4
2 100 2 708483 708483 708483 817944 8706499 8250302 8.1 9.9
2 100 3 1800809 1800809 1800809 1387939 8706499 8250302 20.7 16.8
2 100 4 2687225 2687225 2687225 2477634 8706499 8250302 30.9 30
2 100 7 370240 370240 370240 344583 8706499 8250302 4.3 4.2
2 100 9 0 0 0 50917 8706499 8250302 0 0.6
2 100 13 936301 936301 936301 1120807 8706499 8250302 10.8 13.6
2 100 14 29527 29527 29527 30200 8706499 8250302 0.3 0.4
2 100 16 342157 342157 342157 202288 8706499 8250302 3.9 2.5
2 100 31 913181 913181 913181 803181 8706499 8250302 10.5 9.7
2 100 35 265659 265659 265659 325072 8706499 8250302 3.1 3.9
3 100 1 192454 192454 192454 184622 1247787 1186656 15.4 15.6
3 100 2 348161 348161 348161 302480 1247787 1186656 27.9 25.5
3 100 3 170328 170328 170328 160408 1247787 1186656 13.7 13.5
3 100 4 321656 321656 321656 293650 1247787 1186656 25.8 24.7
3 100 7 5879 5879 5879 8451 1247787 1186656 0.5 0.7
3 100 13 101171 101171 101171 145107 1247787 1186656 8.1 12.2
3 100 14 1002 1002 1002 1766 1247787 1186656 0.1 0.1
3 100 31 81597 81597 81597 84227 1247787 1186656 6.5 7.1
3 100 35 25539 25539 25539 5945 1247787 1186656 2 0.5
4 100 2 8283 8283 8283 4685 13282 11950 62.4 39.2
4 100 3 0 0 0 2659 13282 11950 0 22.3
4 100 4 4694 4694 4694 4341 13282 11950 35.3 36.3
4 100 35 305 305 305 265 13282 11950 2.3 2.2
5 100 1 45666 45666 45666 47103 232476 203926 19.6 23.1
5 100 2 40844 40844 40844 37518 232476 203926 17.6 18.4
5 100 3 25373 25373 25373 28172 232476 203926 10.9 13.8
5 100 4 83355 83355 83355 75234 232476 203926 35.9 36.9
5 100 7 1048 1048 1048 1229 232476 203926 0.5 0.6
5 100 13 6371 6371 6371 5322 232476 203926 2.7 2.6
5 100 31 7691 7691 7691 9348 232476 203926 3.3 4.6
5 100 35 22128 22128 22128 0 232476 203926 9.5 0
6 100 1 7487 7487 7487 1683 15711 14519 47.7 11.6
6 100 2 0 0 0 5325 15711 14519 0 36.7
6 100 3 0 0 0 424 15711 14519 0 2.9
6 100 4 8224 8224 8224 5412 15711 14519 52.3 37.3
6 100 35 0 0 0 1675 15711 14519 0 11.5
7 100 1 2618 2618 2618 0 17701 15038 14.8 0
7 100 2 8026 8026 8026 5383 17701 15038 45.3 35.8
7 100 4 7057 7057 7057 9655 17701 15038 39.9 64.2
8 100 2 3951 3951 3951 6396 12650 10148 31.2 63
8 100 3 2960 2960 2960 2861 12650 10148 23.4 28.2
8 100 4 5388 5388 5388 0 12650 10148 42.6 0
8 100 13 0 0 0 279 12650 10148 0 2.7
8 100 35 351 351 351 612 12650 10148 2.8 6
9 100 1 15826 15826 15826 17247 122094 117512 13 14.7
9 100 2 30448 30448 30448 27946 122094 117512 24.9 23.8
9 100 3 6294 6294 6294 10982 122094 117512 5.2 9.3
9 100 4 36918 36918 36918 31271 122094 117512 30.2 26.6
9 100 7 629 629 629 964 122094 117512 0.5 0.8
9 100 13 19828 19828 19828 22597 122094 117512 16.2 19.2
9 100 31 7569 7569 7569 6505 122094 117512 6.2 5.5
9 100 35 4582 4582 4582 0 122094 117512 3.8 0
10 100 1 88483 88483 88483 93011 665505 603171 13.3 15.4
10 100 2 132363 132363 132363 111306 665505 603171 19.9 18.5
10 100 3 136958 136958 136958 128028 665505 603171 20.6 21.2
10 100 4 171727 171727 171727 121727 665505 603171 25.8 20.2
10 100 7 4796 4796 4796 4482 665505 603171 0.7 0.7
10 100 8 16526 16526 16526 19610 665505 603171 2.5 3.3
10 100 13 78754 78754 78754 75178 665505 603171 11.8 12.5
10 100 16 7401 7401 7401 4430 665505 603171 1.1 0.7
10 100 31 24644 24644 24644 32451 665505 603171 3.7 5.4
10 100 35 3853 3853 3853 12948 665505 603171 0.6 2.1
11 100 1 88630 88630 88630 87751 509590 473811 17.4 18.5
11 100 2 90990 90990 90990 76699 509590 473811 17.9 16.2
11 100 3 87845 87845 87845 87371 509590 473811 17.2 18.4
11 100 4 146369 146369 146369 122761 509590 473811 28.7 25.9
11 100 7 7542 7542 7542 5683 509590 473811 1.5 1.2
11 100 13 47138 47138 47138 54096 509590 473811 9.3 11.4
11 100 14 0 0 0 2855 509590 473811 0 0.6
11 100 31 30717 30717 30717 32257 509590 473811 6 6.8
11 100 35 10359 10359 10359 4338 509590 473811 2 0.9
12 100 1 15516 15516 15516 16194 224674 267917 6.9 6
12 100 2 13131 13131 13131 13229 224674 267917 5.8 4.9
12 100 3 71451 71451 71451 87475 224674 267917 31.8 32.7
12 100 4 30654 30654 30654 33089 224674 267917 13.6 12.4
12 100 5 23218 23218 23218 41077 224674 267917 10.3 15.3
12 100 7 4946 4946 4946 5406 224674 267917 2.2 2
12 100 13 38483 38483 38483 47408 224674 267917 17.1 17.7
12 100 16 946 946 946 756 224674 267917 0.4 0.3
12 100 31 20543 20543 20543 15267 224674 267917 9.1 5.7
12 100 35 5786 5786 5786 8016 224674 267917 2.6 3
13 100 1 84163 84163 84163 90352 591527 546942 14.2 16.5
13 100 2 62648 62648 62648 52896 591527 546942 10.6 9.7
13 100 3 146067 146067 146067 119209 591527 546942 24.7 21.8
13 100 4 170945 170945 170945 137544 591527 546942 28.9 25.1
13 100 7 15087 15087 15087 19125 591527 546942 2.6 3.5
13 100 13 59157 59157 59157 98426 591527 546942 10 18
13 100 16 3083 3083 3083 0 591527 546942 0.5 0
13 100 31 41232 41232 41232 28756 591527 546942 7 5.3
13 100 35 9145 9145 9145 634 591527 546942 1.5 0.1
14 100 1 7933 7933 7933 6681 65006 60545 12.2 11
14 100 2 1682 1682 1682 1297 65006 60545 2.6 2.1
14 100 3 17822 17822 17822 15836 65006 60545 27.4 26.2
14 100 4 25399 25399 25399 23886 65006 60545 39.1 39.5
14 100 7 1605 1605 1605 1138 65006 60545 2.5 1.9
14 100 12 0 0 0 1929 65006 60545 0 3.2
14 100 13 3109 3109 3109 4135 65006 60545 4.8 6.8
14 100 16 1117 1117 1117 2041 65006 60545 1.7 3.4
14 100 31 4407 4407 4407 3602 65006 60545 6.8 5.9
14 100 35 1932 1932 1932 0 65006 60545 3 0
15 100 1 6373 6373 6373 7561 17841 15610 35.7 48.4
15 100 2 2836 2836 2836 0 17841 15610 15.9 0
15 100 4 8502 8502 8502 7720 17841 15610 47.7 49.5
15 100 35 130 130 130 329 17841 15610 0.7 2.1
16 100 2 2423 2423 2423 3460 2796 5647 86.7 61.3
16 100 3 0 0 0 493 2796 5647 0 8.7
16 100 4 68 68 68 1642 2796 5647 2.4 29.1
16 100 35 305 305 305 52 2796 5647 10.9 0.9
17 100 1 250067 250067 250067 238749 1730612 1592232 14.4 15
17 100 2 325919 325919 325919 309162 1730612 1592232 18.8 19.4
17 100 3 220292 220292 220292 202056 1730612 1592232 12.7 12.7
17 100 4 596745 596745 596745 498675 1730612 1592232 34.5 31.3
17 100 7 25007 25007 25007 24907 1730612 1592232 1.4 1.6
17 100 13 149904 149904 149904 167752 1730612 1592232 8.7 10.5
17 100 14 2715 2715 2715 4006 1730612 1592232 0.2 0.3
17 100 16 19883 19883 19883 14768 1730612 1592232 1.1 0.9
17 100 31 101161 101161 101161 116528 1730612 1592232 5.8 7.3
17 100 35 38919 38919 38919 15629 1730612 1592232 2.2 1
18 100 1 40419 40419 40419 39429 294087 289279 13.7 13.6
18 100 2 70181 70181 70181 73617 294087 289279 23.9 25.4
18 100 3 52256 52256 52256 49521 294087 289279 17.8 17.1
18 100 4 89958 89958 89958 86607 294087 289279 30.6 29.9
18 100 7 2999 2999 2999 0 294087 289279 1 0
18 100 13 15424 15424 15424 15958 294087 289279 5.2 5.5
18 100 16 3472 3472 3472 0 294087 289279 1.2 0
18 100 31 18381 18381 18381 24147 294087 289279 6.3 8.3
18 100 35 997 997 997 0 294087 289279 0.3 0
19 100 1 416996 416996 416996 404732 3194420 2985938 13.1 13.6
19 100 2 383333 383333 383333 387057 3194420 2985938 12 13
19 100 3 524588 524588 524588 491674 3194420 2985938 16.4 16.5
19 100 4 1133774 1133774 1133774 941416 3194420 2985938 35.5 31.5
19 100 7 110570 110570 110570 108794 3194420 2985938 3.5 3.6
19 100 9 3521 3521 3521 0 3194420 2985938 0.1 0
19 100 13 227412 227412 227412 292070 3194420 2985938 7.1 9.8
19 100 16 31643 31643 31643 29768 3194420 2985938 1 1
19 100 31 271333 271333 271333 253970 3194420 2985938 8.5 8.5
19 100 35 91250 91250 91250 76457 3194420 2985938 2.9 2.6
20 100 1 52354 52354 52354 49376 487213 431109 10.7 11.5
20 100 2 74743 74743 74743 64522 487213 431109 15.3 15
20 100 3 49926 49926 49926 54501 487213 431109 10.2 12.6
20 100 4 196316 196316 196316 158108 487213 431109 40.3 36.7
20 100 7 11927 11927 11927 11499 487213 431109 2.4 2.7
20 100 13 41501 41501 41501 45694 487213 431109 8.5 10.6
20 100 16 13664 13664 13664 12283 487213 431109 2.8 2.8
20 100 31 32374 32374 32374 35126 487213 431109 6.6 8.1
20 100 35 14408 14408 14408 0 487213 431109 3 0
21 100 1 173248 173248 173248 172015 819141 838007 21.1 20.5
21 100 2 144822 144822 144822 152507 819141 838007 17.7 18.2
21 100 3 102354 102354 102354 117874 819141 838007 12.5 14.1
21 100 4 123385 123385 123385 97701 819141 838007 15.1 11.7
21 100 9 0 0 0 6959 819141 838007 0 0.8
21 100 13 74352 74352 74352 101514 819141 838007 9.1 12.1
21 100 16 0 0 0 8851 819141 838007 0 1.1
21 100 18 110448 110448 110448 141853 819141 838007 13.5 16.9
21 100 31 12388 12388 12388 8287 819141 838007 1.5 1
21 100 35 78144 78144 78144 30446 819141 838007 9.5 3.6
22 100 1 767775 767775 767775 791855 3432901 3392731 22.4 23.3
22 100 2 152961 152961 152961 95035 3432901 3392731 4.5 2.8
22 100 3 867689 867689 867689 691700 3432901 3392731 25.3 20.4
22 100 4 657844 657844 657844 589612 3432901 3392731 19.2 17.4
22 100 7 25259 25259 25259 44108 3432901 3392731 0.7 1.3
22 100 9 149132 149132 149132 138031 3432901 3392731 4.3 4.1
22 100 13 463882 463882 463882 667608 3432901 3392731 13.5 19.7
22 100 14 0 0 0 2435 3432901 3392731 0 0.1
22 100 16 21095 21095 21095 11268 3432901 3392731 0.6 0.3
22 100 31 258727 258727 258727 284065 3432901 3392731 7.5 8.4
22 100 35 68537 68537 68537 77014 3432901 3392731 2 2.3
23 100 1 126257 126257 126257 153775 861135 933044 14.7 16.5
23 100 2 304723 304723 304723 324554 861135 933044 35.4 34.8
23 100 3 123170 123170 123170 140579 861135 933044 14.3 15.1
23 100 4 210727 210727 210727 184518 861135 933044 24.5 19.8
23 100 8 0 0 0 9615 861135 933044 0 1
23 100 9 6352 6352 6352 0 861135 933044 0.7 0
23 100 13 72408 72408 72408 98794 861135 933044 8.4 10.6
23 100 31 17498 17498 17498 7429 861135 933044 2 0.8
23 100 35 0 0 0 13780 861135 933044 0 1.5
24 100 1 37359 37359 37359 39049 178241 174725 21 22.3
24 100 2 4611 4611 4611 7291 178241 174725 2.6 4.2
24 100 3 40116 40116 40116 29064 178241 174725 22.5 16.6
24 100 4 30838 30838 30838 22118 178241 174725 17.3 12.7
24 100 7 1883 1883 1883 0 178241 174725 1.1 0
24 100 9 20806 20806 20806 24678 178241 174725 11.7 14.1
24 100 13 29398 29398 29398 36357 178241 174725 16.5 20.8
24 100 16 1174 1174 1174 0 178241 174725 0.7 0
24 100 31 12056 12056 12056 15843 178241 174725 6.8 9.1
24 100 35 0 0 0 325 178241 174725 0 0.2
25 100 1 195801 195801 195801 210473 1249861 1173993 15.7 17.9
25 100 2 102009 102009 102009 94336 1249861 1173993 8.2 8
25 100 3 229396 229396 229396 172932 1249861 1173993 18.4 14.7
25 100 4 190786 190786 190786 160261 1249861 1173993 15.3 13.7
25 100 7 5002 5002 5002 8246 1249861 1173993 0.4 0.7
25 100 9 31592 31592 31592 87141 1249861 1173993 2.5 7.4
25 100 13 192077 192077 192077 288938 1249861 1173993 15.4 24.6
25 100 16 0 0 0 1312 1249861 1173993 0 0.1
25 100 31 84225 84225 84225 63922 1249861 1173993 6.7 5.4
25 100 33 153734 153734 153734 63100 1249861 1173993 12.3 5.4
25 100 35 65239 65239 65239 23332 1249861 1173993 5.2 2
26 100 1 4058 4058 4058 4071 46794 44866 8.7 9.1
26 100 2 12379 12379 12379 10211 46794 44866 26.5 22.8
26 100 3 13863 13863 13863 12118 46794 44866 29.6 27
26 100 4 8938 8938 8938 6493 46794 44866 19.1 14.5
26 100 7 416 416 416 643 46794 44866 0.9 1.4
26 100 8 0 0 0 4320 46794 44866 0 9.6
26 100 13 5187 5187 5187 7010 46794 44866 11.1 15.6
26 100 31 1123 1123 1123 0 46794 44866 2.4 0
26 100 35 830 830 830 0 46794 44866 1.8 0

Code

read "gemeinderesultate.csv"
dup
select s > 0
extend f = (s/(z+1) -1)
project p, f stddev
join left
update f_stddev = 0 where f_stddev == ""
project inline g, s sum
rename s_sum ok
update ok = 1 where ok > 0
extend z2 = z * ok
dup
project p, s sum, z2 sum
join natural
dup
project p, k, s sum, z2 sum
rename s_sum s_kanton, z2_sum z2_kanton
join natural
dup
project k, z2 sum, z sum
extend kp = round(100*(z2_sum / z_sum))
project k, kp
join natural
extend proj = s
extend projmax = s
extend projmin = s
extend fpk = s_kanton/(z2_kanton+1)*kp/100 + s_sum/(z2_sum+1)*(1-kp/100)
update proj = round(z * fpk) where not ok
update projmin = round(max(0,z * ((fpk -1)*(1-2*f_stddev)+1))) where not ok
update projmax = round(max(0,z * ((fpk-1)*(1+2*f_stddev)+1))) where not ok
extend c = projmin
update projmin = projmax where projmax < projmin
update projmax = c where projmax < c
project k,kp,p,proj sum, projmin sum, projmax sum, z sum
project inline k, proj_sum sum
project inline k, z_sum sum
extend perc = round(1000*proj_sum/proj_sum_sum)/10
extend perc_alt = round(1000*z_sum/z_sum_sum)/10
write "kantonsresultate.csv"
print}