Skip to content

Instantly share code, notes, and snippets.

@hughdbrown
hughdbrown / data-chronic-kidney-disease.md
Last active August 31, 2015 17:35
Chronic kidney disease predictor

Chronic kidney disease

Description

Data source

@hughdbrown
hughdbrown / data-bitly.md
Last active September 1, 2015 10:42
Analysis of bit.ly data

Bit.ly data

Description

GermanWings crash/suicide news story spreads over bit.ly links.

Data source

  • bit.ly
  • twitter

Display style

@hughdbrown
hughdbrown / data-movie-factors.md
Created August 31, 2015 15:18
Factors in movie revenue

Movie factors

Description

Movies are released and have varying levels of financial success. Can we figure out how successful a film will be by assessing its factors before its release?

Data sources

  • IMDB for movie particulars (genre, actors, director, etc.)
  • movie revenue source?
@hughdbrown
hughdbrown / data-real-estate-factors.md
Last active August 31, 2015 15:15
Factors in real estate prices

Real estate factors

Description

Real estate prices within an area can be predicted from past sales in an area with the addition of various factors:

  • number of bedrooms
  • number of bathrooms
  • square footage of house
  • square footage of lot

In addition, we might speculate that a couple of other factors that are not commonly recorded at at play:

@hughdbrown
hughdbrown / data-denver-drivers.md
Created August 31, 2015 15:06
Denver dreivers

Denver drivers

Description

Since arriving in Denver, I have noticed that Denver drivers do a whole range of semi-dangerous things on the road:

  • Changing lane with insufficient space
  • Lefthand turns in front of oncoming traffic
  • Running orange/red lights
  • Driving through totally red lights
  • Passing on the right on the highway
from scapy.all import *
AMAZON_TABLE = {
'74:75:48:5f:99:30': 'Huggies,
'10:ae:60:00:4d:f3': 'Elements',
}
def is_arp(arp):
return (arp.op, arp.prc) == (1, '0.0.0.0')
import ConfigParser
import os.path
def get_creds():
botofile = os.path.expanduser("~/.boto")
with open(botofile) as f:
c = ConfigParser.ConfigParser()
c.readfp(f)
return tuple(
@hughdbrown
hughdbrown / numpy-fragment.md
Created August 20, 2015 19:39
Useful fragments of numpy code

Selection

where

>>> import numpy as np
>>> a = np.array([[7, 4, 3, 7],
...  [7, 2, 5, 4],
...  [1, 7, 5, 1]])
>>> for (i, j) in zip(*np.where(a % 2 == 0)):
...     print("[{0}, {1}]: {2}".format(i, j, a[i, j]))
... 
@hughdbrown
hughdbrown / hours-to-build-shelves.md
Last active August 29, 2015 14:27
Hours taken to install shelves
Day Time Total
Friday 2.00 hours
Saturday 10:00 - 18:00 8.00 hours
Saturday 19:30 - 21:30 2.00 hours
Sunday 4.00 hours
Monday 10:00 - 17:30 7.50 hours
Tuesday 09:00 - 17:00 8.00 hours

31.5 hours total