Skip to content

Instantly share code, notes, and snippets.

@cmrivers
cmrivers / nltk_share.py
Created December 12, 2012 18:42
Code for basic NLTK functions for processing tweets
from nltk.corpus import stopwords
from nltk.stem.wordnet import WordNetLemmatizer
from nltk import SnowballStemmer
import string
import nltk
import re
lmt = WordNetLemmatizer()
stemmer = SnowballStemmer("english")
freqdist = nltk.FreqDist()
Data sources:
CDC data on vaccine coverage: http://www.cdc.gov/flu/professionals/vaccination/reporti1112/reporti/index.htm
CDC data on current influenza situation: http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html
Historical flu data: http://www.cdc.gov/flu/weekly/pastreports.htm
Locations of hospitals in Boston: https://data.cityofboston.gov/Public-Health/Hospital-Locations/46f7-2snz
NetLogo, a simple agent based model: http://ccl.northwestern.edu/netlogo/
Nemsis, emergency medical services API (haven't used this one myself): http://www.nemsis.org/v3/downloads/v3Archive.html
Written for R, but useful for epi basics in any language: cran.r-project.org/doc/contrib/Epicalc_Book.pdf
"Provides access to health statistics and information on hospital inpatient and emergency department utilization": http://hcupnet.ahrq.gov/
Healthcare Research and Quality data directory: http://www.ahrq.gov/data/dataresources.htm
@cmrivers
cmrivers / README_esi
Last active December 11, 2015 05:59
Codebook for nrvi_esi
DOCUMENTATION
Author: Caitlin Rivers
Date: 01102013
##############################
VARIABLE: explanation
possible values
and/or format
Missing: 999
###############################
computer:~$ howdoi matplotlib alternative x11
> import matplotlib
> # Force matplotlib to not use any Xwindows backend.
> matplotlib.use('Agg')
@cmrivers
cmrivers / open_access_impact_factor
Created January 24, 2013 20:49
* This code accompanies [this blog post](www.caitlinrivers.com). * Source data is available at [Journal Metrics](http://www.journalmetrics.com/values.php) and at [Directory of Open Access Journals](www.doaj.org/doaj?func=csv). * **Please not that I have not been able to sort the open access and closed access journals perfectly (see authors note …
{
"metadata": {
"name": "open_access_impact_factor"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@cmrivers
cmrivers / open_access_impact.py
Last active December 11, 2015 16:28
* This code accompanies [this blog post](www.caitlinrivers.com). * Source data is available at [Journal Metrics](http://www.journalmetrics.com/values.php) and at [Directory of Open Access Journals](www.doaj.org/doaj?func=csv). * **Please not that I have not been able to sort the open access and closed access journals perfectly (see authors note …
{
"metadata": {
"name": "open_access_impact_factor_Mar"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
{
"metadata": {
"name": "words_in_title"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
big4 <- read.csv("~/Dropbox/Open_source_journals/big4_titlelength.csv")
us <- big4[big4$Country == 'United States',]
germ <- big4[big4$Country == 'Germany',]
neth <- big4[big4$Country == 'Netherlands',]
uk <- big4[big4$Country == 'United Kingdom',]
ust <- tapply(us$X2011.SNIP2, us$title_wordcnt, mean, na.rm=TRUE)[1:7]
ukt <- tapply(uk$X2011.SNIP2, uk$title_wordcnt, mean, na.rm=TRUE)[1:7]
germt <- tapply(germ$X2011.SNIP2, germ$title_wordcnt, mean, na.rm=TRUE)[1:7]
netht <- tapply(neth$X2011.SNIP2, neth$title_wordcnt, mean, na.rm=TRUE)[1:7]
@cmrivers
cmrivers / day2_software_carpentry.md
Last active December 12, 2015 01:29
sqlite, python, testing

Link to github

###parameters for easy viz .header on .mode column

###basic queries select * from table limit 10; select column, column from table limit 10; select distinct column, column from table;

@cmrivers
cmrivers / fungal_meningitis.ipynb
Last active December 13, 2015 21:58
Updated Mar 13 with data from March 11
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.