This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/env python | |
""" | |
Assign colors to each school's pin | |
""" | |
from BeautifulSoup import BeautifulSoup | |
# Hash to store style values | |
styles = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(googleVis) | |
gSee <- function(df) { | |
return(plot(gvisTable(df, options = list(showRowNumber = TRUE, | |
page = 'enable', | |
pageSize = 30)))) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps -eo pmem,pcpu, vsize, user, pid, cmd | sort -k 1 -nr | head -15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xlrd | |
import os | |
import gzip | |
workbook = xlrd.open_workbook("example.xlsx") | |
worksheet = workbook.sheet_by_index(0) | |
for row_num in range(0, worksheet.nrows): | |
row_values = [v.value for v in worksheet.row(row_num) if v.value] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save file as matplotlibrc in folder ~/.matplotlib | |
backend: TkAgg | |
# Enable fonts | |
# See: http://matplotlib.org/1.3.1/users/usetex.html | |
font.family : serif | |
font.serif : Times, Palatino, New Century Schoolbook, Bookman, Computer Modern Roman | |
font.sans-serif : Helvetica, Avant Garde, Computer Modern Sans serif | |
font.cursive : Zapf Chancery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
webuse nlswork, clear | |
gen count_ln_wage = !missing(ln_wage) | |
collapse (sum) count_ln_wage (mean) ln_wage, by(grade year) | |
label var count_ln_wage "Number of individuals" | |
label var ln_wage "Average log(wage)" | |
levelsof year, local(years) | |
foreach yr of local years { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
webuse nlswork, clear | |
gen grade_bin = floor(grade/2) * 2 + 1 | |
levelsof year, local(years) | |
foreach yr of local years { | |
binscatter ln_wage grade if year == `yr', linetype(connect) xq(grade_bin) msymbol(none) title("`yr'") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(readxl) | |
library(ggplot2) | |
library(reshape2) | |
asq.data <- read_excel("ASQ.xlsx") | |
variables <- c("Interval" , | |
"CommunicationResults" , | |
"GrossMotorResults" , | |
"FineMotorResults" , | |
"ProblemSolvingResults", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cut -d , -f1-3 input.csv > output.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear all | |
set obs 10000 | |
capture program drop detect_rd | |
program define detect_rd, rclass | |
syntax varlist(numeric max=1) [if] | |
if "`if'" == "" { | |
local ifcond "" | |
} | |
else { |
OlderNewer