Skip to content

Instantly share code, notes, and snippets.

View cjgunase's full-sized avatar
:bowtie:
bioinfomaticsguy

CJG cjgunase

:bowtie:
bioinfomaticsguy
View GitHub Profile
@cjgunase
cjgunase / beautiful_idiomatic_python.md
Created January 24, 2017 18:35 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@cjgunase
cjgunase / density2d_map.R
Created September 17, 2017 19:17 — forked from jwbargsten/density2d_map.R
plot pretty 2d density map with ggplot2
library(ggplot2)
library(MASS)
## generate some random data
data <- data.frame(a=abs(rnorm(1000, mean=0.5)), b=abs(rnorm(1000, mean=0.5)))
data$a <- data$a / max(data$a)
data$b <- data$b / max(data$b)
## layout settings for ggplot
@cjgunase
cjgunase / barplot_heatmap.png
Created January 2, 2018 16:41 — forked from slowkow/barplot_heatmap.png
Plot a horizontal bar plot and the lower triangle of a heatmap aligned at the base of the bars
barplot_heatmap.png