Skip to content

Instantly share code, notes, and snippets.

@Gijs-Koot
Gijs-Koot / read_network.ipynb
Last active October 1, 2017 13:00
Import train network madrid as gexf. See http://moreno.ss.uci.edu/data.html#train.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
library(dplyr)
## use a vector for the files and the dataframes, where we leave a column in some of them
fn <- c("test_1.csv", "test_2.csv", "test_3.csv")
dl <- c(
mtcars %>% select(-gear),
mtcars %>% select(-disp),
mtcars %>% select(-wt)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Gijs-Koot
Gijs-Koot / parse_knvb_scores.py
Created February 13, 2017 14:22
Download and parse current year KNVB eredivisie results and schedule from their site.
from bs4 import BeautifulSoup
import requests
import dateparser
import pandas as pd
uitslagen_url = "http://www.knvb.nl/competities/eredivisie/uitslagen"
programma_url = "http://www.knvb.nl/competities/eredivisie/programma"
uitslagen_soup = BeautifulSoup(requests.get(uitslagen_url).content, "lxml")
programma_soup = BeautifulSoup(requests.get(programma_url).content, "lxml")
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Gijs-Koot
Gijs-Koot / check_ov_bikes.gist
Last active February 2, 2017 15:59
"Oneliner" voor het bekijken van het beschikbaar aantal OV-fietsen op alle stations in Nederland.
## Dependencies:
* httpie
* csvkit
* jq
* json2csv
## Dit is de regel (filtert op utrecht en amsterdam, pas aan naar wens)
http http://fiets.openov.nl/locaties.json | jq '[.locaties[] | {loc: .description, bikes: (try .extra.rentalBikes | tonumber), date: .extra.fetchTime | todate}] | sort_by(-.bikes)' | json2csv | csvsql --query "SELECT * FROM stdin WHERE loc LIKE 'Ams%' OR loc LIKE 'Utr%' LIMIT 100" | csvlook

http://andrewgelman.com/wp-content/uploads/2012/11/frequentists_vs_bayesians.png

Question 1

There are three types of coins which have different probabilities of landing heads when tossed.

  • Type A coins are fair, with probability .5 of heads
  • Type B coins are bent and have probability .6 of heads
  • Type C coins are bent and have probability .9 of heads

I hereby claim:

  • I am gijs-koot on github.
  • I am gijskoot (https://keybase.io/gijskoot) on keybase.
  • I have a public key ASCpvk5-58h7ioVTS37qBVtpJg1YOrunTMH-egtNhJEl4go

To claim this, I am signing this object:

{