Skip to content

Instantly share code, notes, and snippets.

# conda create -n pd python
# (source) conda activate pd
# conda install pandas
# conda install matplotlib
# remove pd environment
import json
import os
import datetime as dt
import pandas as pd
import pandas as pd
import matplotlib.pyplot as plt
# Import Data
data = pd.read_csv('scrubbed.csv')
data.head()
#Prepare "shapes" column for donut plot entry
shapes = data['shape'].value_counts(normalize=True) * 100
Keys = shapes.keys().to_list()
@davidbradway
davidbradway / used_leaf.csv
Last active October 5, 2018 20:47
This is a list of used Leaf cars pulled from CarMax on Oct 5th 2018
Year Model Price Mileage Dealer City State Transfer Fee Stock #
2013 S 7998 53 Pleasanton Pleasanton CA 949 16298916
2011 SL 7998 83 West Sahara Las Vegas NV 799 16260846
2011 SL 7998 71 Ontario Los Angeles CA 949 16287068
2011 SL 8599 44 Serramonte San Francisco CA 949 15868010
2011 SL 8599 43 Clackamas Clackamas OR 999 16338496
2011 SL 8599 48 LAX Los Angeles CA 949 16529550
2012 SV 8599 60 Henderson Las Vegas NV 799 16260281
2011 SV 8599 50 Sacramento/Roseville Roseville CA 949 16298061
2012 SL 8998 54 Henderson Las Vegas NV 799 16111897
@davidbradway
davidbradway / .block
Last active February 9, 2018 19:37 — forked from mbostock/.block
Lab Notebook Meta-data. A look at prices charged at the Duke University Bookstore over 20 years.
license: gpl-3.0
@davidbradway
davidbradway / get-singularity.sh
Created December 19, 2017 22:09
install and set up singularity on an Ubuntu machine (needs root access)
sudo apt-get update
sudo apt-get install -y python dh-autoreconf build-essential
sudo apt-get install -y automake autoconf libtool
git clone https://github.com/singularityware/singularity.git
cd singularity
./autogen.sh
./configure --prefix=/usr/local
make
sudo make install
singularity run shub://vsoch/singularity-images

Keybase proof

I hereby claim:

  • I am davidbradway on github.
  • I am davidbradway (https://keybase.io/davidbradway) on keybase.
  • I have a public key ASCuLH-bl5srBYIsIOqlOXoYzkpaS76RN23NC061r8S7mwo

To claim this, I am signing this object:

@davidbradway
davidbradway / setup.md
Last active May 19, 2020 22:00
Set Up Docker On Raspberry Pi Raspbian Stretch Lite
@davidbradway
davidbradway / durham-dockless.m
Created November 29, 2017 19:33
Cost Analysis of Bike Shares in Durham (MATLAB)
%% Cost Analysis of Bike Shares in Durham
rpm = 1:105; % rides per month
L1 = rpm;
L2 = 14 * ceil(rpm/100);
S1 = 5 * ceil(rpm/6);
S2 = 29 + 0*rpm;
figure(1), clf
subplot(2,1,1)
+-------------------------+
| [POWER] [LIGHT] | KEY_POWER SOURCE
| SOURCE |
| [ 1 ] [ 2 ] [ 3 ] | KEY_1 KEY_2 KEY_3
| |
| [ 4 ] [ 5 ] [ 6 ] | KEY_4 KEY_5 KEY_6
| |
| [ 7 ] [ 8 ] [ 9 ] | KEY_7 KEY_8 KEY_9
| |
| [ - ] [ 0 ] PRE-CH | KEY_TEXT KEY_0 KEY_PREVIOUS
@davidbradway
davidbradway / BN59-01041A.cfg
Created February 24, 2017 14:26
LIRC Config, brand: Samgung, model no. of remote control: BN59-01041A, devices being controlled by this remote: LN46D630
# Please make this file available to others
# by sending it to <winlirc.configs@gmail.com>
#
# this config file was automatically generated
# using lirc-0.9.0(MCE) on Fri Feb 24 09:12:40 2017
#
# contributed by David Bradway
#
# brand: Samgung