Skip to content

Instantly share code, notes, and snippets.

View CZ020_kraje2020_euro2019_1000_900.html
<div>
<script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<div id="52dc101e-066a-4cb9-bd22-9445f42a0556" class="plotly-graph-div" style="height:500px; width:100%;"></div>
<script type="text/javascript">
window.PLOTLYENV=window.PLOTLYENV || {};
if (document.getElementById("52dc101e-066a-4cb9-bd22-9445f42a0556")) {
@michalskop
michalskop / README.md
Last active Mar 25, 2020
CZ+DE: Covid19 by regions
View README.md

Covid-19: Comparison of Czech and German regions.

I joined several Czech regions to make them of similar size as the German states.

@michalskop
michalskop / README.md
Last active Mar 5, 2020
CZ: support by age
View README.md

Distribution of voters' support by age

Czechia, 10-11/2019

@michalskop
michalskop / README.md
Last active Oct 23, 2019
Regions of Czechia - cartogram
View README.md

Kraje ČR - kartogram

@michalskop
michalskop / README.md
Last active Sep 20, 2019
Prague: spatial distribution 2018-2019
View README.md

WPCA Analysis of Prague Assembly

2018 - 06/2019

Analysis flow

  • Raspberry update data: home/pi/project/praha.eu-scraper/scraper.py
  • update local data: download_datapackage.py
  • cd /home/michal/dev/wpca/praha_2018-2019/
  • cp data/votes.csv x_source.csv
  • correct paths in wpca.py, load_datapackage.py
@michalskop
michalskop / d3.tip.js
Last active Aug 4, 2019
CZ: Euroelections 2019
View d3.tip.js
// d3.tip
// Copyright (c) 2013 Justin Palmer
//
// Tooltips for d3.js SVG visualizations
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module with d3 as a dependency.
define(['d3'], factory)
} else {
@michalskop
michalskop / .Rhistory
Last active May 31, 2019
CZ: voters changes 2014-2019
View .Rhistory
mat
matsd/mat
1.96*matsd/mat
print(x.out)
print(z.out)
par_input = "/home/michal/dev/senat/2016/data_1.csv"
library("Zelig")
library("ZeligEI")
data <- read.csv(par_input, header = TRUE, fileEncoding = "utf-8", encoding = "utf-8")
variables <- names(data)
@michalskop
michalskop / c2.html
Last active Apr 17, 2018
CZ: spatial distribution
View c2.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>W-PCA Scatterplot Chart</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="WPCA scatter plot">
<meta name="author" content="Michal Škop">
<script src="http://d3js.org/d3.v3.min.js"></script>
View data_2018_2.csv
We can't make this file beautiful and searchable because it's too large.
OBEC,OKRSEK,VOLICI,OBALKY_VYDANE,OBALKY_ODEVZDANE,HLASY,HLASY_01,HLASY_02,HLASY_03,HLASY_04,HLASY_05,HLASY_06,HLASY_07,HLASY_08,HLASY_09
541281,5,123,54,54,54,,,,,,,38,,16
549584,2,79,58,58,58,,,,,,,24,,34
547701,1,68,47,47,47,,,,,,,19,,28
587206,1,66,47,47,47,,,,,,,24,,23
573060,5,123,77,77,77,,,,,,,46,,31
575500,8,64,40,40,40,,,,,,,29,,11
563960,3,82,45,45,45,,,,,,,23,,22
597678,6,35,30,30,30,,,,,,,25,,5
572667,1,171,125,125,125,,,,,,,74,,51