- https://team.carto.com/u/mamataakella/builder/58119064-9b87-11e6-a960-0e3ebc282e83/embed?state=%7B%22map%22%3A%7B%22ne%22%3A%5B8.667918002363134%2C-124.01367187500001%5D%2C%22sw%22%3A%5B61.3546135846894%2C-74.79492187500001%5D%2C%22center%22%3A%5B39.80853604144591%2C-99.40429687500001%5D%2C%22zoom%22%3A4%7D%2C%22widgets%22%3A%7B%22449698c3-546d-4e3a-af52-fc8a78e4350d%22%3A%7B%22normalized%22%3Atrue%7D%7D%7D
- https://medium.com/@Stuart_Lynn/all-the-trees-national-day-of-civic-hacking-ny-tree-census-ebb8c642c8cb
- https://observatory.cartodb.com/viz/7e3e69f2-2a89-11e6-a8ee-0ecfd53eb7d3/embed_map?referrer=https%3A%2F%2Fmedium.com%2Fmedia%2F38f668081cb24398fa2eaec957d0d958%3FpostId%3Debb8c642c8cb
- https://observatory.cartodb.com/viz/175161ea-2a84-11e6-8883-0e31c9be1b51/embed_map?referrer=https%3A%2F%2Fmedium.com%2Fmedia%2F1ab6c53c9730f0d2afe9e5b6586c5776%3FpostId%3Debb8c642c8cb
- https://observatory.cartodb.com/viz/1b59f52e-2a6e-11e6-8898-0e5db1731f59/embed_map?referrer=https%3A%2F%2Fmedium.com%2Fmedia%2
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
@app.route('/bar.img') | |
def bar(): | |
query = request.args.get('q') | |
username = request.args.get('username') | |
api_key = request.args.get('apikey') | |
xlabel = request.args.get('xlabel') | |
ylabel = request.args.get('ylabel') | |
title = request.args.get('title') |
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
# Run a query over the CARTO SQL api | |
def carto_query(query,username,api_key): | |
params = {'q' : query, 'format':'csv'} | |
if api_key: | |
params['api_key'] = api_key | |
url = 'https://{}.carto.com/api/v2/sql?'.format(username) + urlencode(params) | |
return pandas.read_csv(url) | |
Lambda is a serverless code execution enviromnent on AWS that can run abitrary python or node code. When a function is triggered it spins up runs and then exists.
Analysis currently is run at the Database level through plpythonu functions.
The Linear programing framework we where using is called CVXOPT, which consists of some C libraries and a python module that calls them
This is the install that worked in a Docker container we have been using for development of tha algorthum. The full docker container is
apt-get install -yq libopenblas-dev libatlas-dev libblas-dev libglpk-dev glpk-utils liblapack-dev libsuitesparse-dev gsl-bin libgsl0-dev libfftw3-dev libblas-test libopenblas-base libopenblas-dev
git clone https://github.com/cvxopt/cvxopt.git
cd cvxopt
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
from kaggle/python | |
RUN apt-get install -yq libopenblas-dev libatlas-dev libblas-dev libglpk-dev glpk-utils liblapack-dev libsuitesparse-dev gsl-bin libgsl0-dev libfftw3-dev libblas-test libopenblas-base libopenblas-dev | |
RUN git clone https://github.com/cvxopt/cvxopt.git |
Presenters :
- Stuart Lynn, Carto, stuart@carto.com
- Andy Eschbacher, CARTO, eschbacher@cartodb.com
Primary Contact Email: stuart@carto.com
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 requests | |
import json | |
import pandas as pd | |
class PageFreezer: | |
state_lookup = { -1: "Removal", 0: "Change", 1: "Addition" } | |
def __init__(self,url_1, url_2, api_key = None): | |
self.api_key = api_key |
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
CREATE OR REPLACE FUNCTION cdb_dot_density(g geometry , no_points Integer, max_iter Integer DEFAULT 1000 ) | |
RETURNS setof geometry AS | |
$$ | |
DECLARE | |
extent GEOMETRY; | |
test_point Geometry; | |
width NUMERIC; | |
height NUMERIC; | |
x0 NUMERIC; | |
y0 NUMERIC; |
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 pandas as pd | |
from urllib import urlencode | |
from IPython.display import IFrame | |
from urllib import urlencode | |
from collections import OrderedDict | |
import matplotlib | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
import urllib2 | |
import requests |