Skip to content

Commit

Permalink
Merge branch 'master' of github.com:com-480-data-visualization/com-48…
Browse files Browse the repository at this point in the history
…0-project-statiswiss
  • Loading branch information
fabnemEPFL committed May 31, 2024
2 parents eece23e + 9b2d89a commit 9885d65
Show file tree
Hide file tree
Showing 14 changed files with 47,306 additions and 545 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Do you want to know how the Swiss population voted on a particular issue? Do you
If you are not a politics aficionado, don't run away! Take a look at our website, check the notable votes, or maybe search for one that you remember, you may be suprised at the results! Browsing through our website may motivate you to vote next time you receive that famous envelope from the Confederation!

## 😎 Where can I find this amazing website?
Lucky for you, Statiswiss is easily accessible by clicking on the following link: [**🇨🇭Statiswiss**](https://com-480-data-visualization.github.io/com-480-project-statiswiss/)
Lucky for you, Statiswiss is easily accessible by clicking on the following link: [**🇨🇭Statiswiss🇨🇭**](https://com-480-data-visualization.github.io/com-480-project-statiswiss/)

## 🚀 What if I want to run it locally?
No problem! All you need to do is
Expand Down
1 change: 1 addition & 0 deletions create_JSON/662.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"zh":{"eli":965383,"cas":432213,"par":44.7711426,"val":424712,"yes":325482,"no":99230,"per":76.6359321},"be":{"eli":746563,"cas":328362,"par":43.9831602,"val":319617,"yes":239532,"no":80085,"per":74.9434479},"lu":{"eli":285114,"cas":119717,"par":41.9891692,"val":117176,"yes":92217,"no":24959,"per":78.6995631},"ur":{"eli":27031,"cas":11134,"par":41.1897451,"val":10861,"yes":7908,"no":2953,"per":72.810975},"sz":{"eli":107429,"cas":52700,"par":49.0556554,"val":52151,"yes":39231,"no":12920,"per":75.2257867},"ow":{"eli":27534,"cas":13599,"par":49.3898453,"val":13145,"yes":10144,"no":3001,"per":77.1700266},"nw":{"eli":31860,"cas":15769,"par":49.4946642,"val":15433,"yes":12272,"no":3161,"per":79.5179162},"gl":{"eli":26317,"cas":10505,"par":39.9171638,"val":10309,"yes":7558,"no":2751,"per":73.3145795},"zg":{"eli":78837,"cas":39984,"par":50.7173028,"val":39639,"yes":32638,"no":7001,"per":82.3381014},"fr":{"eli":214399,"cas":82260,"par":38.3677163,"val":80116,"yes":64621,"no":15495,"per":80.659294},"so":{"eli":182823,"cas":72289,"par":39.5404298,"val":71032,"yes":55488,"no":15544,"per":78.1169051},"bs":{"eli":114085,"cas":54213,"par":47.5198317,"val":52899,"yes":43016,"no":9883,"per":81.3172272},"bl":{"eli":190801,"cas":81505,"par":42.7172814,"val":79012,"yes":64204,"no":14808,"per":81.258543},"sh":{"eli":53615,"cas":33896,"par":63.2211135,"val":30774,"yes":23346,"no":7428,"per":75.8627413},"ar":{"eli":38991,"cas":17917,"par":45.9516299,"val":17652,"yes":13327,"no":4325,"per":75.4985271},"ai":{"eli":12245,"cas":4561,"par":37.2478563,"val":4437,"yes":3449,"no":988,"per":77.7327023},"sg":{"eli":330842,"cas":135916,"par":41.0818457,"val":134197,"yes":102867,"no":31330,"per":76.6537255},"gr":{"eli":141829,"cas":55799,"par":39.3424476,"val":54228,"yes":42154,"no":12074,"per":77.7347496},"ag":{"eli":441619,"cas":179902,"par":40.7369248,"val":177060,"yes":136340,"no":40720,"per":77.0021462},"tg":{"eli":178631,"cas":74205,"par":41.5409419,"val":71995,"yes":54947,"no":17048,"per":76.3205778},"ti":{"eli":224885,"cas":88351,"par":39.2871912,"val":84079,"yes":63711,"no":20368,"per":75.7751638},"vd":{"eli":472177,"cas":194121,"par":41.1119135,"val":187706,"yes":160826,"no":26880,"per":85.6797332},"vs":{"eli":232514,"cas":90375,"par":38.8686273,"val":86356,"yes":69022,"no":17334,"per":79.9272778},"ne":{"eli":113950,"cas":40979,"par":35.9622642,"val":40019,"yes":33891,"no":6128,"per":84.6872735},"ge":{"eli":276401,"cas":110854,"par":40.1062225,"val":106997,"yes":91563,"no":15434,"per":85.5752965},"ju":{"eli":54380,"cas":17497,"par":32.1754321,"val":16946,"yes":13555,"no":3391,"per":79.989378}}
1 change: 1 addition & 0 deletions create_JSON/663.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"zh":{"eli":965383,"cas":435539,"par":45.1156691,"val":432818,"yes":270333,"no":162485,"per":62.4588164},"be":{"eli":746563,"cas":328378,"par":43.9853033,"val":325442,"yes":190464,"no":134978,"per":58.5247141},"lu":{"eli":285114,"cas":120279,"par":42.1862834,"val":118879,"yes":70116,"no":48763,"per":58.9809807},"ur":{"eli":27031,"cas":11325,"par":41.8963412,"val":11160,"yes":4811,"no":6349,"per":43.109319},"sz":{"eli":107429,"cas":53042,"par":49.3740052,"val":52762,"yes":22414,"no":30348,"per":42.4813313},"ow":{"eli":27534,"cas":13680,"par":49.684027,"val":13408,"yes":5880,"no":7528,"per":43.8544153},"nw":{"eli":31860,"cas":15914,"par":49.9497803,"val":15740,"yes":7367,"no":8373,"per":46.8043202},"gl":{"eli":26317,"cas":10518,"par":39.9665615,"val":10444,"yes":4803,"no":5641,"per":45.9881272},"zg":{"eli":78837,"cas":40158,"par":50.9380113,"val":39944,"yes":22999,"no":16945,"per":57.5781094},"fr":{"eli":214399,"cas":82405,"par":38.4353472,"val":81378,"yes":50377,"no":31001,"per":61.9049375},"so":{"eli":182823,"cas":72750,"par":39.7925863,"val":72215,"yes":38192,"no":34023,"per":52.8865194},"bs":{"eli":114085,"cas":54213,"par":47.5198317,"val":53751,"yes":39396,"no":14355,"per":73.2935201},"bl":{"eli":190801,"cas":81968,"par":42.9599426,"val":80174,"yes":45888,"no":34286,"per":57.2355128},"sh":{"eli":53615,"cas":34127,"par":63.6519631,"val":32138,"yes":16751,"no":15387,"per":52.1220985},"ar":{"eli":38991,"cas":18114,"par":46.4568747,"val":17981,"yes":9160,"no":8821,"per":50.9426617},"ai":{"eli":12245,"cas":4586,"par":37.4520212,"val":4493,"yes":2089,"no":2404,"per":46.4945471},"sg":{"eli":330842,"cas":136800,"par":41.3490427,"val":136049,"yes":70775,"no":65274,"per":52.0216981},"gr":{"eli":141829,"cas":56514,"par":39.8465758,"val":55508,"yes":30780,"no":24728,"per":55.4514665},"ag":{"eli":441619,"cas":180669,"par":40.9106039,"val":179477,"yes":93550,"no":85927,"per":52.1236704},"tg":{"eli":178631,"cas":74560,"par":41.7396756,"val":72943,"yes":35964,"no":36979,"per":49.3042513},"ti":{"eli":224885,"cas":88418,"par":39.3169842,"val":86016,"yes":47160,"no":38856,"per":54.8270089},"vd":{"eli":472177,"cas":194262,"par":41.1417752,"val":191854,"yes":133365,"no":58489,"per":69.5137969},"vs":{"eli":232514,"cas":90413,"par":38.8849704,"val":87129,"yes":48262,"no":38867,"per":55.3914311},"ne":{"eli":113950,"cas":41103,"par":36.0710838,"val":40657,"yes":28408,"no":12249,"per":69.8723467},"ge":{"eli":276401,"cas":110854,"par":40.1062225,"val":108401,"yes":80746,"no":27655,"per":74.4882427},"ju":{"eli":54380,"cas":17547,"par":32.2673777,"val":17290,"yes":10924,"no":6366,"per":63.1810295}}
1 change: 1 addition & 0 deletions create_JSON/664.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"zh":{"eli":965383,"cas":434467,"par":45.0046251,"val":429671,"yes":285571,"no":144100,"per":66.4627122},"be":{"eli":746563,"cas":328323,"par":43.9779362,"val":323035,"yes":201044,"no":121991,"per":62.2359806},"lu":{"eli":285114,"cas":120325,"par":42.2024173,"val":118381,"yes":72495,"no":45886,"per":61.2387123},"ur":{"eli":27031,"cas":11281,"par":41.7335652,"val":11056,"yes":5688,"no":5368,"per":51.447178},"sz":{"eli":107429,"cas":53048,"par":49.3795902,"val":52720,"yes":24119,"no":28601,"per":45.7492413},"ow":{"eli":27534,"cas":13577,"par":49.3099441,"val":13237,"yes":6271,"no":6966,"per":47.3747828},"nw":{"eli":31860,"cas":15832,"par":49.6924043,"val":15607,"yes":8637,"no":6970,"per":55.3405523},"gl":{"eli":26317,"cas":10537,"par":40.0387582,"val":10429,"yes":5591,"no":4838,"per":53.6101256},"zg":{"eli":78837,"cas":40112,"par":50.8796631,"val":39809,"yes":24011,"no":15798,"per":60.3155065},"fr":{"eli":214399,"cas":82480,"par":38.4703287,"val":80849,"yes":49592,"no":31257,"per":61.3390394},"so":{"eli":182823,"cas":72712,"par":39.7718011,"val":71924,"yes":43252,"no":28672,"per":60.1356988},"bs":{"eli":114085,"cas":54213,"par":47.5198317,"val":53243,"yes":38354,"no":14889,"per":72.0357606},"bl":{"eli":190801,"cas":81769,"par":42.8556454,"val":79647,"yes":50228,"no":29419,"per":63.0632667},"sh":{"eli":53615,"cas":34034,"par":63.4785041,"val":31750,"yes":17630,"no":14120,"per":55.5275591},"ar":{"eli":38991,"cas":17931,"par":45.9875356,"val":17737,"yes":9169,"no":8568,"per":51.6941986},"ai":{"eli":12245,"cas":4575,"par":37.3621886,"val":4466,"yes":2168,"no":2298,"per":48.5445589},"sg":{"eli":330842,"cas":136422,"par":41.2347888,"val":135327,"yes":74061,"no":61266,"per":54.727438},"gr":{"eli":141829,"cas":56261,"par":39.668192,"val":54993,"yes":32406,"no":22587,"per":58.9274999},"ag":{"eli":441619,"cas":180673,"par":40.9115097,"val":179029,"yes":105834,"no":73195,"per":59.1155623},"tg":{"eli":178631,"cas":74564,"par":41.7419149,"val":72754,"yes":38786,"no":33968,"per":53.3111581},"ti":{"eli":224885,"cas":88330,"par":39.2778531,"val":85358,"yes":49317,"no":36041,"per":57.7766583},"vd":{"eli":472177,"cas":194234,"par":41.1358452,"val":190075,"yes":129534,"no":60541,"per":68.1488886},"vs":{"eli":232514,"cas":90380,"par":38.8707777,"val":86724,"yes":51561,"no":35163,"per":59.4541303},"ne":{"eli":113950,"cas":40737,"par":35.7498903,"val":39933,"yes":27581,"no":12352,"per":69.0681892},"ge":{"eli":276401,"cas":110854,"par":40.1062225,"val":107171,"yes":74951,"no":32220,"per":69.9358968},"ju":{"eli":54380,"cas":17483,"par":32.1496874,"val":17069,"yes":10365,"no":6704,"per":60.7241197}}
1 change: 1 addition & 0 deletions create_JSON/665.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"zh":{"eli":968595,"cas":570425,"par":58.8920034,"val":567515,"yes":295601,"no":271914,"per":52.0869052},"be":{"eli":747589,"cas":432170,"par":57.8085017,"val":429769,"yes":241979,"no":187790,"per":56.3044333},"lu":{"eli":285958,"cas":167335,"par":58.5173347,"val":165653,"yes":77143,"no":88510,"per":46.5690329},"ur":{"eli":27053,"cas":16927,"par":62.5697705,"val":16784,"yes":7318,"no":9466,"per":43.6010486},"sz":{"eli":108075,"cas":68015,"par":62.9331483,"val":67862,"yes":28783,"no":39079,"per":42.4140167},"ow":{"eli":27633,"cas":17822,"par":64.4953498,"val":17466,"yes":7068,"no":10398,"per":40.4671934},"nw":{"eli":32022,"cas":20590,"par":64.2995441,"val":20400,"yes":8971,"no":11429,"per":43.9754902},"gl":{"eli":26877,"cas":15133,"par":56.3046471,"val":14994,"yes":8456,"no":6538,"per":56.3958917},"zg":{"eli":78825,"cas":51658,"par":65.535046,"val":51485,"yes":21583,"no":29902,"per":41.9209478},"fr":{"eli":215906,"cas":127633,"par":59.1150779,"val":126425,"yes":91444,"no":34981,"per":72.3306308},"so":{"eli":183296,"cas":108566,"par":59.2298795,"val":108144,"yes":64969,"no":43175,"per":60.0763796},"bs":{"eli":113922,"cas":67702,"par":59.4283808,"val":67078,"yes":43235,"no":23843,"per":64.4548138},"bl":{"eli":191091,"cas":113356,"par":59.3204285,"val":110868,"yes":67241,"no":43627,"per":60.6496013},"sh":{"eli":53995,"cas":38640,"par":71.5621817,"val":37583,"yes":21183,"no":16400,"per":56.3632493},"ar":{"eli":39225,"cas":23490,"par":59.8852772,"val":23342,"yes":10806,"no":12536,"per":46.2942336},"ai":{"eli":12249,"cas":7019,"par":57.3026369,"val":6941,"yes":2183,"no":4758,"per":31.4507996},"sg":{"eli":331512,"cas":188036,"par":56.720722,"val":187353,"yes":91321,"no":96032,"per":48.7427476},"gr":{"eli":142195,"cas":80121,"par":56.3458631,"val":78902,"yes":40888,"no":38014,"per":51.8212466},"ag":{"eli":443581,"cas":253254,"par":57.0930676,"val":252469,"yes":132707,"no":119762,"per":52.5636811},"tg":{"eli":179814,"cas":99119,"par":55.1230716,"val":96955,"yes":47252,"no":49703,"per":48.7360116},"ti":{"eli":225377,"cas":130923,"par":58.0906659,"val":129679,"yes":92050,"no":37629,"per":70.9829656},"vd":{"eli":475731,"cas":276924,"par":58.210207,"val":274507,"yes":204085,"no":70422,"per":74.3460094},"vs":{"eli":233798,"cas":143834,"par":61.5206289,"val":141514,"yes":91747,"no":49767,"per":64.8324547},"ne":{"eli":114148,"cas":65035,"par":56.974279,"val":64624,"yes":50682,"no":13942,"per":78.4259718},"ge":{"eli":278541,"cas":146410,"par":52.5631774,"val":143288,"yes":108146,"no":35142,"per":75.4745687},"ju":{"eli":54438,"cas":33242,"par":61.0639627,"val":33021,"yes":27255,"no":5766,"per":82.5383847}}
1 change: 1 addition & 0 deletions create_JSON/666.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"zh":{"eli":968595,"cas":566601,"par":58.4972047,"val":560430,"yes":170682,"no":389748,"per":30.4555431},"be":{"eli":747589,"cas":432166,"par":57.8079667,"val":426963,"yes":106077,"no":320886,"per":24.8445416},"lu":{"eli":285958,"cas":166546,"par":58.2414201,"val":164102,"yes":44503,"no":119599,"per":27.1191088},"ur":{"eli":27053,"cas":16691,"par":61.6974088,"val":16516,"yes":3765,"no":12751,"per":22.7960765},"sz":{"eli":108075,"cas":67439,"par":62.4001851,"val":67098,"yes":19588,"no":47510,"per":29.1931205},"ow":{"eli":27633,"cas":17823,"par":64.4989686,"val":17325,"yes":4720,"no":12605,"per":27.2438672},"nw":{"eli":32022,"cas":20530,"par":64.1121729,"val":20292,"yes":5723,"no":14569,"per":28.2032328},"gl":{"eli":26877,"cas":15064,"par":56.047922,"val":14845,"yes":3694,"no":11151,"per":24.8837993},"zg":{"eli":78825,"cas":51439,"par":65.2572154,"val":51175,"yes":15406,"no":35769,"per":30.1045432},"fr":{"eli":215906,"cas":126728,"par":58.695914,"val":125088,"yes":24488,"no":100600,"per":19.5766181},"so":{"eli":183296,"cas":107988,"par":58.9145426,"val":107262,"yes":27633,"no":79629,"per":25.7621525},"bs":{"eli":113922,"cas":67702,"par":59.4283808,"val":65685,"yes":18289,"no":47396,"per":27.8434955},"bl":{"eli":191091,"cas":112517,"par":58.8813707,"val":109462,"yes":29221,"no":80241,"per":26.6951088},"sh":{"eli":53995,"cas":38344,"par":71.0139828,"val":36878,"yes":10996,"no":25882,"per":29.8172352},"ar":{"eli":39225,"cas":23263,"par":59.3065647,"val":23055,"yes":6322,"no":16733,"per":27.4213836},"ai":{"eli":12249,"cas":7014,"par":57.2618173,"val":6911,"yes":2023,"no":4888,"per":29.2721748},"sg":{"eli":331512,"cas":186697,"par":56.3168151,"val":184901,"yes":49566,"no":135335,"per":26.8067777},"gr":{"eli":142195,"cas":79573,"par":55.9604768,"val":77967,"yes":20632,"no":57335,"per":26.4624777},"ag":{"eli":443581,"cas":252142,"par":56.8423805,"val":250479,"yes":65679,"no":184800,"per":26.2213599},"tg":{"eli":179814,"cas":98655,"par":54.8650272,"val":96123,"yes":25765,"no":70358,"per":26.8041988},"ti":{"eli":225377,"cas":130803,"par":58.0374217,"val":128710,"yes":31603,"no":97107,"per":24.5536477},"vd":{"eli":475731,"cas":276487,"par":58.1183484,"val":272651,"yes":40647,"no":232004,"per":14.9080693},"vs":{"eli":233798,"cas":143628,"par":61.4325187,"val":140242,"yes":33437,"no":106805,"per":23.8423582},"ne":{"eli":114148,"cas":64745,"par":56.7202229,"val":64065,"yes":11849,"no":52216,"per":18.4952782},"ge":{"eli":278541,"cas":146410,"par":52.5631774,"val":141549,"yes":31369,"no":110180,"per":22.1612304},"ju":{"eli":54438,"cas":33060,"par":60.7296374,"val":32734,"yes":4901,"no":27833,"per":14.9722002}}
26 changes: 26 additions & 0 deletions create_JSON/add_662_to_666.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import json
import pandas as pd
import numpy as np

#change 662-666 as necessary
with open("666.json", "r", encoding="utf-8") as f:
data = json.load(f)

with open("good_data.json", "r", encoding="utf-8") as f:
missing = json.load(f)

for index, it in data.items():
canton = f"{index}"
missing["666"][f"{canton}-ja"] = it["yes"]
missing["666"][f"{canton}-nein"] = it["no"]
missing["666"][f"{canton}-japroz"] = it["per"]
missing["666"]["gultig"] = it["val"]
missing["666"][f"{canton}-berecht"] = it["cas"]
if it["per"] >= 50.00:
missing["666"][f"{canton}-annahme"] = 1.00
else:
missing["666"][f"{canton}-annahme"] = 0.00


with open("good_data.json", "w", encoding="utf-8") as f:
json.dump(missing, f, indent=4, ensure_ascii=False)
2 changes: 1 addition & 1 deletion create_JSON/data.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"305":{
"date":"05.04.1981",
"titre_court_de":"Initiative «für eine neue Ausländerpolitik»",
Expand Down
Loading

0 comments on commit 9885d65

Please sign in to comment.