Sung to the tune of 'Take It Easy' by The Eagles
Well, I'm in debug mode
tryin' to rewrite my code
I've got algoritihms on my mind
Five that Chase told me,
Two that someone showed me,
But K-means is a friend of mine
Sung to the tune of 'Take It Easy' by The Eagles
Well, I'm in debug mode
tryin' to rewrite my code
I've got algoritihms on my mind
Five that Chase told me,
Two that someone showed me,
But K-means is a friend of mine
<style type="text/css" media="screen"> | |
#map-canvas {width: 620px; height: 600px;} | |
.circleBase { | |
-moz-border-radius: 999px; /* Firefox */ | |
-webkit-border-radius: 999px; /* Safari and Chrome */ | |
border-radius: 999px; /* Opera 10.5+, future browsers, and now also Internet Explorer 6+ using IE-CSS3 */ | |
behavior: url(ie-css3.htc); /* This lets IE know to call the script on all elements which get the 'box' class */ | |
float: left; | |
} | |
.barrettcircle {width: 25px; height: 25px; background: #37949b; opacity: .7} |
Moved the csv file - about 4.5 mb - to github as it was too big for a gist. Find it here.
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Search the Congressional Record using Capitol Words API</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="viewport" id="meta-viewport" content="width=device-width,minimum-scale=1,maximum-scale=1"> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> | |
<link rel="apple-touch-icon" href="http://media.scpr.org/assets/images/icon.png"> | |
<meta name="format-detection" content="telephone=no"/> |
year | overall | big_ten | big_ten_finish | big_ten_tournament | ncaa_tournament | date | round | opponent | opponent_seed | opponent_half | opponent_final | badgers_seed | badgers_half | badgers_final | badgers_result | url | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2014 | 26-7 | 12-6 | second | 1-1 | 3/20/2014 | First Round | American | 15 | 2 | ||||||||
2013 | 23-12 | 12-6 | 2-1 | 0-1 | 3/22/2013 | First Round | Ole Miss | 12 | 22 | 57 | 5 | 25 | 46 | Loss | http://espn.go.com/ncb/boxscore?gameId=330810275 | ||
2012 | 26-10 | 12-6 | 1-1 | 2-1 | 3/22/2012 | Sweet Sixteen | Syracuse | 1 | 33 | 64 | 4 | 27 | 63 | Loss | http://espn.go.com/ncb/boxscore?gameId=320820183 | ||
2012 | 26-10 | 12-6 | 1-1 | 2-1 | 3/17/2012 | Second Round | Vanderbilt | 5 | 31 | 57 | 4 | 32 | 50 | Win | http://espn.go.com/ncb/boxscore?gameId=320770275 | ||
2012 | 26-10 | 12-6 | 1-1 | 2-1 | 3/15/2012 | First Round | Montana | 13 | 29 | 49 | 4 | 39 | 73 | Win | http://espn.go.com/ncb/boxscore?gameId=320750275 | ||
2011 | 25-9 | 13-5 | 0-1 | 2-1 | 3/24/2011 | Sweet Sixteen | Butler | 8 | 33 | 61 | 4 | 24 | 54 | Loss | http://espn.go.com/ncb/boxscore?gameId=310830275 | ||
2011 | 25-9 | 13-5 | 0-1 | 2-1 | 3/19/2011 | Second Round | Kansas State | 5 | 30 | 65 | 4 | 36 | 70 | Win | http://espn.go.com/ncb/boxscore?gameId=310780275 |
from __future__ import with_statement | |
import os | |
import time, datetime | |
from fabric.operations import prompt | |
from fabric.api import * | |
from fabric.contrib.console import confirm | |
from fabric.colors import green | |
env.hosts = ['{{YOUR WEBFACTION PATH}}'] |
Code allows us to make all kinds of visuals and tools that display data for analysis.
But when you're starting to mix code, data and journalism - and you lack a deep statistics background to draw upon - everything looks like a nail that you can whack with your shiny hammer. And everything - scatterplots to nearest neighbor to regression - seems important.
So how do you move from citing only the average, median & percent change in all of your work and begin to build skills and knowledge that can lead to a deeper analysis of datasets?
I propose a discussion that helps beginning data journalists/news apps developers better understand which analytical and statistical methods are best suited to different data situations.
For example:
I helped the folks at #wjchat a while back by writing a quick django app to pull tweets each week and save them to a database. The tweets were then accessible as formatted HTML that could be posted in the #wjchat Wordpress blog.
But something happened around the middle of April. The script pulled in 389 tweets on April 16, but the following week only caught 100. Same for the week after.
I did some hand-holding for a few weeks, but more and more of the same occurred.
#wjchat-transcript news: @ChrisLKeller & I are aware we’re a couple weeks behind. Pipes running the transcripts are a little clogged. Soon!
— P. Kim Bui (@kimbui) June 20, 2014
# Uses wrapper found here: https://github.com/datadesk/python-googlegeocoder | |
# pip install python-googlegeocoder | |
from googlegeocoder import GoogleGeocoder | |
import time | |
import logging | |
logging.basicConfig(format='\033[1;36m%(levelname)s:\033[0;37m %(message)s', level=logging.DEBUG) | |
def create_list_addresses_from_file(): |
getCheckboxIds: function(event){ | |
var activeCheckboxes = []; | |
if (!$("input:checkbox").is(":checked")) { | |
console.log("box is not checked"); | |
} | |
$("input:checkbox").each(function(){ | |
var $this = $(this); | |
if($this.is(":checked")){ | |
var categoryId = $this.attr("id"); | |
if (categoryId != undefined){ |