Skip to content

Instantly share code, notes, and snippets.

View patrickvossler18's full-sized avatar

Patrick Vossler patrickvossler18

View GitHub Profile
# Example taken from https://www.tensorflow.org/tutorials/estimator/premade
import tensorflow as tf
import numpy as np
import pandas as pd
IRIS_TRAINING = "~/Downloads/iris_training.csv"
IRIS_TEST = "~/Downloads/iris_test.csv"
CSV_COLUMN_NAMES = ['SepalLength', 'SepalWidth', 'PetalLength', 'PetalWidth', 'Species']
library(tidyverse)
library(tabulizer)
download.file(url = "https://floridadisaster.org/globalassets/covid19/dailies/covid-19-data---daily-report-2020-03-29-1002.pdf",
destfile = "fl_covid_data.pdf")
f = "fl_covid_data.pdf"
out1 <- extract_tables(f,pages = 21:89,method = "stream")
# It looks like every so often it mis-reads multi-line rows. You could probably
#!/bin/bash -eu
# Taken from https://github.com/amacneil/git-banish-large-files/blob/master/pre-receive.sh
# The difference here is that we are doing a pre-push hook on the local side instead of a pre-receive hook like in the above link.
# As a result, we want to read different variables from stdin than in the other script.
set -o pipefail
maxsize=100
maxbytes=$(( $maxsize * 1024 * 1024 ))
status=0
@patrickvossler18
patrickvossler18 / venmo_scrape.py
Created October 13, 2015 22:48
Python script for scraping venmo transactions from Venmo's public API. This script can be run on an amazon web server with a simple nohup command to produce a csv with transaction data.
# -*- coding: utf-8 -*-
import requests
import json
from datetime import datetime
import csv
import time
class scraping:
def __init__(self):
@patrickvossler18
patrickvossler18 / WSJ_home_adv.py
Created October 12, 2015 01:38
Short script to scrape data from Wall Street Journal article about home field advantage for college football using Selenium. The table isn't a static html table so in order to scrape all of the data I needed a way to click through each number while scraping.
from selenium import webdriver
import csv
from bs4 import BeautifulSoup
from selenium.webdriver.common.action_chains import ActionChains
import time
pred_SoS = "SoS.csv"
pred_SoS_headers= ["Rank", "Team", "Conference", "SoS"]
i = 1
@patrickvossler18
patrickvossler18 / index.html
Created May 17, 2015 08:40
DPS interactive map
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="data:application/x-javascript,%28function%28%29%20%7B%0A%20%20%2F%2F%20If%20window%2EHTMLWidgets%20is%20already%20defined%2C%20then%20use%20it%3B%20otherwise%20create%20a%0A%20%20%2F%2F%20new%20object%2E%20This%20allows%20preceding%20code%20to%20set%20options%20that%20affect%20the%0A%20%20%2F%2F%20initialization%20process%20%28though%20none%20currently%20exist%29%2E%0A%20%20window%2EHTMLWidgets%20%3D%20window%2EHTMLWidgets%20%7C%7C%20%7B%7D%3B%0A%0A%20%20%2F%2F%20See%20if%20we%27re%20running%20in%20a%20viewer%20pane%2E%20If%20not%2C%20we%27re%20in%20a%20web%20browser%2E%0A%20%20var%20viewerMode%20%3D%20window%2EHTMLWidgets%2EviewerMode%20%3D%0A%20%20%20%20%20%20%2F%5Cbviewer%5Fpane%3D1%5Cb%2F%2Etest%28window%2Elocation%29%3B%0A%0A%20%20%2F%2F%20See%20if%20we%27re%20running%20in%20Shiny%20mode%2E%20If%20not%2C%20it%27s%20a%20static%20document%2E%0A%20%20%2F%2F%20Note%20that%20static%20widgets%20can%20appear%20in%20both%20Shiny%20and%20static%2
@patrickvossler18
patrickvossler18 / index.html
Last active August 29, 2015 14:21
USC instagram interactive map
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="data:application/x-javascript,%28function%28%29%20%7B%0A%20%20%2F%2F%20If%20window%2EHTMLWidgets%20is%20already%20defined%2C%20then%20use%20it%3B%20otherwise%20create%20a%0A%20%20%2F%2F%20new%20object%2E%20This%20allows%20preceding%20code%20to%20set%20options%20that%20affect%20the%0A%20%20%2F%2F%20initialization%20process%20%28though%20none%20currently%20exist%29%2E%0A%20%20window%2EHTMLWidgets%20%3D%20window%2EHTMLWidgets%20%7C%7C%20%7B%7D%3B%0A%0A%20%20%2F%2F%20See%20if%20we%27re%20running%20in%20a%20viewer%20pane%2E%20If%20not%2C%20we%27re%20in%20a%20web%20browser%2E%0A%20%20var%20viewerMode%20%3D%20window%2EHTMLWidgets%2EviewerMode%20%3D%0A%20%20%20%20%20%20%2F%5Cbviewer%5Fpane%3D1%5Cb%2F%2Etest%28window%2Elocation%29%3B%0A%0A%20%20%2F%2F%20See%20if%20we%27re%20running%20in%20Shiny%20mode%2E%20If%20not%2C%20it%27s%20a%20static%20document%2E%0A%20%20%2F%2F%20Note%20that%20static%20widgets%20can%20appear%20in%20both%20Shiny%20and%20static%2