Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# ## Plotting COVID19 Data in the US | |
# In[ ]: | |
get_ipython().run_cell_magic('bash', '', '\nCOVID_DATA_DIR=./covid-19-data/\n\nif [ ! -d ${COVID_DATA_DIR} ]; then\n git clone https://github.com/nytimes/covid-19-data.git\nelse\n cd ${COVID_DATA_DIR} && git pull\nfi') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# list all jupyter kernels | |
jupyter kernelspec list | |
# remove kernel | |
jupyter kernelspec uninstall ${kernel_name} | |
# add venv to kernels | |
# prereqs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.sql.SparkSession | |
import org.apache.spark.sql.functions._ | |
import org.apache.spark.sql.DataFrame | |
import org.apache.spark.ml.linalg.Vector | |
import org.apache.spark.sql.expressions.UserDefinedFunction | |
object FeatureVectorQuantiles { | |
// Simple helper to convert vector to array<double> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime as dt | |
import urllib.request | |
import json | |
import pandas as pd | |
def boston_hourly_weather(start_time, end_time): | |
lat, long = 42.3603, -71.0583 | |
key = '' | |
temp_data = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import urllib.request | |
import re | |
from urllib.error import URLError | |
from subprocess import run, PIPE | |
def get_instance_id(timeout=5): | |
try: | |
return urllib.request.urlopen( | |
"http://169.254.169.254/latest/meta-data/instance-id", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.ml.linalg.{SparseVector, Vectors} | |
import org.apache.spark.ml.feature.StandardScaler | |
import org.apache.spark.sql.SparkSession | |
object censusAggregation { | |
val usage = """ | |
Usage: censusAggregation pathToCensus outputPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import requests | |
import pandas as pd | |
import datetime as dt | |
from bs4 import BeautifulSoup | |
def get_site_divs(category): | |
alexa_base_url = "https://www.alexa.com/topsites/category/Top/" | |
if not category: | |
# default to global top sites |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
event_time, | |
--user_id, | |
advertiser_id, | |
campaign_id, | |
ad_id, | |
rendering_id, | |
creative_version, | |
site_id_dcm, | |
placement_id, |
NewerOlder