Skip to content

Instantly share code, notes, and snippets.

View dwreeves's full-sized avatar

Daniel Reeves dwreeves

  • Battery
  • Boston, MA
View GitHub Profile
@dwreeves
dwreeves / excel_dir.do
Last active May 10, 2019 15:36
Import Directory of Excel Files into Stata
#delimit cr
version 13.1
clear all
set more off
/*******************************************************************************
* Import Directory of Excel Files into Stata
*
* Author: Daniel Reeves
* https://github.com/dwreeves
*
Sub UpdateDir()
''' Create list of files in spreadsheet named "list." '''
If ThisWorkbook.Path = "" Then
MsgBox "Please save this file first"
Stop
End If
'--------------------------------------------------------------------------
@dwreeves
dwreeves / uber_and_lyft_exploratory.do
Created June 13, 2019 04:27
exploratory analysis of Chicago public ride share data
import delimited "Transportation_Network_Providers_-_Trips.csv", delimiter(comma) varnames(1) stripquote(yes) asdouble
drop pickupcentroidlocation dropoffcentroidlocation //redundant
/* var : Share Trip Authorized */
replace sharedtripauthorized = "0" if sharedtripauthorized=="false"
replace sharedtripauthorized = "1" if sharedtripauthorized=="true"
destring sharedtripauthorized, replace
label def lbl_truefalse 0 "false" 1 "true"
label values sharedtripauthorized lbl_truefalse
@dwreeves
dwreeves / sliding_puzzle.py
Last active July 21, 2019 02:14
my attempt to solve a sliding puzzle. Didn't quite finish it. Next step would be to deterministically reduce to 3x3.
puzzle1 = [
[4,1,3],
[2,8,0],
[7,6,5]
]
cant_be_solved = [
[1,2,3],
[4,5,6],
[0,8,7]
]
@dwreeves
dwreeves / ridoh.ipynb
Created September 9, 2019 17:30
Analysis of RIDOH water sample data.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dwreeves
dwreeves / c4b sdw - data processes.md
Last active September 10, 2019 00:42
Safe Drinking Water Project - Recommendations for storage, processing, and cleaning of data

Code for Boston - Safe Drinking Water Project

Daniel Reeves - process notes and recommendations

Summary of recommendations

  • Separate out processed and raw data in the data/ folder.
  • Include README.md files within each folder containing data files; also utilize the Issues tab in GitHub more often.
  • Utilizes branches in the GitHub workflow, and keep the master branch's data folder "clean," so to speak.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dwreeves
dwreeves / definitions.py
Last active May 17, 2020 00:51
Module for `import_census_tract_data`, a function that allows for easy import of Census data into a Pandas DataFrame format.
"""
Definitions of various constants. Adjust based on project structure and needs.
"""
import os
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Files and Directories
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@dwreeves
dwreeves / split_columns_hobolink_export_2.csv
Created November 27, 2020 20:30
Another glitchy hobolink output