Skip to content

Instantly share code, notes, and snippets.

View kokes's full-sized avatar

Ondrej Kokes kokes

View GitHub Profile
@kokes
kokes / koubsky.ipynb
Last active September 25, 2015 19:59
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kokes
kokes / strukturalni-fondy.ipynb
Created September 27, 2015 11:27
Strukturální fondy EU, probraný v Pythonu
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Pěkný to neni, ale zdá se že funguje
# edit: případně vlastně můžem embednout iconv do argumentu gsubu
paste0(unlist(lapply(strsplit(Z, "'")[[1]], function(a) {gsub("'","",iconv(a, to='ASCII//TRANSLIT'))})), collapse="'")
# > Z="příliš žluťoučký 'kůň' s 'apostrofama'"
# > paste0(unlist(lapply(strsplit(Z, "'")[[1]], function(a) {gsub("'","",iconv(a, to='ASCII//TRANSLIT'))})), collapse="'")
# [1] "prilis zlutoucky 'kun' s 'apostrofama"
@kokes
kokes / df-multiindex.ipynb
Created March 2, 2016 19:19
Test of pandas issue #4896 and #10344
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kokes
kokes / mixplot.R
Created March 6, 2016 16:33
Mixplots of normal mixtures in R
library(mclust)
mixplot <- function(ts,plot=TRUE) {
rng=seq(from=min(ts),to=max(ts),by=(max(ts)-min(ts))/1000)
mcp = Mclust(ts)$par
mat=cbind(mcp$mean,mcp$var$sigmasq,mcp$pro)
dens=apply(mat[,-3],1,function(x) dnorm(rng,mean=x[1],sd=sqrt(x[2])))
f=dens%*%mat[,3]
if (plot) {
hist(ts,breaks=100,border="gray",probability=TRUE,main="")
@kokes
kokes / strukturalni-fondy-ipy.ipynb
Created March 6, 2016 16:34
Dnes už starý hrátky s datama ke strukturálním fondům
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kokes
kokes / Issue_2697.ipynb
Created March 9, 2016 00:28
Testing pandas issue #2697
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kokes
kokes / Issue_2728.ipynb
Created March 10, 2016 13:35
Trying to replicate pandas issue #2728
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kokes
kokes / Issue_744.ipynb
Created March 13, 2016 10:07
Recreating issue #744 in pandas.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.