- thing
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
test <- data.frame(state=c("Florida", "Virginia", "Texas", "California", | |
"Georgia", "North Carolina", "New York", | |
"Missouri", "Illinois", "Maryland", "Pennsylvania", | |
"Tennessee", "Colorado", "Washington", "Arizona", | |
"Ohio", "Wisconsin", "District of Columbia", | |
"Michigan", "New Jersey", "Utah", "Louisiana", | |
"Minnesota", "Alabama", "Kansas", "Massachusetts", | |
"Indiana", "South Carolina", "Arkansas", "Oregon", | |
"Nevada", "Kentucky", "Nebraska", "(not set)", | |
"Connecticut", "New Mexico", "Oklahoma", |
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
# oh my quiz | |
What the what? | |
: Option! | |
: Correct option! : |
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
longest.ordered <- function(original) { | |
results <- list() | |
for (item in original) { | |
static_results <- results | |
for (stem in static_results) { | |
if (stem[length(stem)] <= item) { | |
results[[length(results)+1]] <- c(stem, item) | |
} | |
} | |
results[[length(results)+1]] <- item |
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
def _find_getch(): | |
# courtesy of Louis | |
# http://stackoverflow.com/questions/510357/ | |
try: | |
import termios | |
except ImportError: | |
# Non-POSIX. Return msvcrt's (Windows') getch. | |
import msvcrt | |
return msvcrt.getch |
This shows New York City subway usage based on turnstile data. Hovering over a day shows the number of entries through subway turnstiles in that day.
Notice the clear effects of hurricanes Irene and Sandy.
More details and source code available. Visualization based (heavily) on Mike Bostock's excellent example.
This d3.js visualization uses public data from NYC public schools. Original data available largely at http://schools.nyc.gov/Accountability/tools/report/default.htm This is a hacked-together prototype; it does not represent best practices.
oh nothing, nothing...
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
movie_reviews = dict() | |
for line in open('movies.txt.small'): | |
pieces = line.split(':') | |
if len(pieces) > 1: | |
key = pieces[0] | |
value = ':'.join(pieces[1:]).strip() | |
if key == 'product/productId': | |
id = value | |
if key == 'review/text': | |
movie_reviews.setdefault(id, []).append(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
set.seed(54) | |
n <- rnorm(3000,0.5,0.1) | |
par(mar=c(1,1,3,1)) | |
hist(c(runif(10000),runif(1900,0.35,0.65),n[abs(n-0.5)<0.15]), | |
xlim=c(0,1),ylim=c(0,600),breaks=51,ylab="",#main="", | |
main="Statistical Programming DC",col="#C9242D", | |
axes=F, cex.main=2) |
OlderNewer