Skip to content

Instantly share code, notes, and snippets.

@michalskop
michalskop / create_testing_calcs.py
Last active September 2, 2023 10:15
Create testing files for Slovak calculators
"""Create testing files for calcs."""
# import gspread
import json
import pandas as pd
import random
import string
path = "calc/"
path1 = path + "kalkulacka/"
<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 March 25, 2020 01:27
CZ+DE: Covid19 by regions

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 March 5, 2020 00:04
CZ: support by age

Distribution of voters' support by age

Czechia, 10-11/2019

@michalskop
michalskop / README.md
Last active October 23, 2019 19:06
Regions of Czechia - cartogram

Kraje ČR - kartogram

@michalskop
michalskop / README.md
Last active September 20, 2019 19:07
Prague: spatial distribution 2018-2019

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 August 4, 2019 13:55
CZ: Euroelections 2019
// 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 16:34
CZ: voters changes 2014-2019
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 / .gitignore
Last active July 29, 2019 21:36
Pollster 2018
~lock
@michalskop
michalskop / c2.html
Last active April 17, 2018 10:03
CZ: spatial distribution
<!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>