INSERT GRAPHIC HERE (include hyperlink in image)
Subtitle or Short Description Goes Here
import pandas as pd | |
from geopandas import GeoDataFrame | |
from shapely.geometry import Point | |
import fiona | |
df = pd.read_csv('data.csv') | |
geometry = [Point(xy) for xy in zip(df.x, df.y)] | |
crs = {'init': 'epsg:2263'} #http://www.spatialreference.org/ref/epsg/2263/ | |
geo_df = GeoDataFrame(df, crs=crs, geometry=geometry) |
def inflate(d, sep="_"): | |
items = dict() | |
for k, v in d.items(): | |
keys = k.split(sep) | |
sub_items = items | |
for ki in keys[:-1]: | |
try: | |
sub_items = sub_items[ki] | |
except KeyError: |
import sqlite3 | |
# open connection and get a cursor | |
conn = sqlite3.connect(':memory:') | |
c = conn.cursor() | |
# create schema for a new table | |
c.execute('CREATE TABLE IF NOT EXISTS sometable (name, age INTEGER)') | |
conn.commit() |
import requests | |
from bs4 import BeautifulSoup | |
import time | |
USER_AGENT = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'} | |
def fetch_results(search_term, number_results, language_code): | |
assert isinstance(search_term, str), 'Search term must be a string' | |
assert isinstance(number_results, int), 'Number of results must be an integer' |
System.setProperty("webdriver.chrome.driver", | |
"/opt/tools/selenium-2.45.0/chromedriver"); | |
File addonpath = new File( | |
"/opt/tools/selenium-2.45.0/innpjfdalfhpcoinfnehdnbkglpmogdi.crx"); | |
ChromeOptions options = new ChromeOptions(); | |
options.addExtensions(addonpath); | |
DesiredCapabilities capabilities = new DesiredCapabilities(); | |
capabilities.setCapability(ChromeOptions.CAPABILITY, options); |
from math import * | |
""" | |
easeInBack: function (x, t, b, c, d, s) { | |
if (s == undefined) s = 1.70158; | |
return c*(t/=d)*t*((s+1)*t - s) + b; | |
}, | |
easeOutBack: function (x, t, b, c, d, s) { |
# ported from http://www.gizma.com/easing/ | |
# by http://th0ma5w.github.io | |
# | |
# untested :P | |
import math | |
linearTween = lambda t, b, c, d : c*t/d + b |
from selenium import webdriver | |
from selenium.webdriver.common.proxy import Proxy | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
import zipfile | |