Skip to content

Instantly share code, notes, and snippets.

View kuanb's full-sized avatar
🚌
trains, buses, bikes, and maps

Kuan Butts kuanb

🚌
trains, buses, bikes, and maps
View GitHub Profile
@kuanb
kuanb / hmm_explore.ipynb
Created October 1, 2019 05:02
Exploring implementing my own Viterbi algorithm for Hidden Markov models
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuanb
kuanb / peartree.ipynb
Last active April 2, 2023 20:00
First stab at using Partridge as the basis for generating a NetworkX Graph of a GTFS feed (please note this is just a hacky sketch)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuanb
kuanb / TIMS.json
Created March 8, 2023 01:15
Raw extract of 10 years of crash data from TIMS in Oakland CA
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuanb
kuanb / PAVING_BIKELANE_RECONCILER.md
Last active February 27, 2023 17:50
Method for creating subset layers that match each other

Paving and bike plan reconciler

Purpose it to create a script that can be referenced to generate an "inner-joined" layer that is the match between the two datasets of paving plan and bike path plan from OakDOT.

@kuanb
kuanb / mit_tech_review_logic_puzzle_plane_boarding.py
Last active January 10, 2023 17:17
Quick and gross sketch to play out logic puzzle about probability of last pax on plane getting their seat if a random pax goes "rogue" and takes seat not assigned to them
import random
class Passenger:
"""Passenger with seating ticket."""
def __init__(self, seat: int):
self.seat_assigned = seat
self.seat_taken = None
self.is_rogue = False # if rogue, pax will sit in wrong seat
def make_rogue(self):
@kuanb
kuanb / partridge_example_script.ipynb
Created November 24, 2017 21:14
Gist to document how to use Partridge with a GTFS feed. See more at: https://github.com/kuanb/peartree
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuanb
kuanb / BikeNetwork_01262022.geojson
Last active March 3, 2022 06:18
Oakland Open Data Bike Paths shapes filedump 02/03/2022
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuanb
kuanb / example_notebook.ipynb
Last active February 21, 2022 21:55
Reference cycleway query for a given polygon area
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuanb
kuanb / change-orders.csv
Created August 23, 2021 02:26
table from cal hsr change orders open data as usable csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 13 columns, instead of 7. in line 2.
,PROJECT,CONTRACT NO.,CHANGE ORDER NO.,APPROVED DATE,CONTRACTOR,CATEGORY,TITLE,AMOUNT ($),DESCRIPTION,AUTHORITY APPROVER,CONTRACTOR COUNTERPARTY,CONSULTANT SUPPORT
0,CP 1,HSR 13-06,00386,6/25/2021,Tutor Perini/Zachry/Parsons,Differing Site Conditions,"AT&T Task 4, Phase II MH-769 Caltrans Water Service Relocation - Construction","$36,061.19",This is a change to a contract for construction services in the Central Valley. The reason for the change is to fully compensate the Contractor for the work performed to relocate the existing Caltrans 2-inch irrigation water service line located at Ashlan Avenue across SR-99 on-ramp. This service line was in physical conflict with the proposed location of the AT&T intercept vault requiring the waterline relocation outside of the proposed AT&T intercept vault footprint location.,Scott Kennedy - Senior Contract Manager,Ghassan Ariqat - Project Manager/Director,Eric Stassevitch - DB Oversight Manager
1,CP 1,HSR 13-06,00119.1 R1,4/2/2021,Tutor Perini/Zachry/Parsons,Third Part