Skip to content

Instantly share code, notes, and snippets.

View andy-esch's full-sized avatar
🌳

Andy Eschbacher andy-esch

🌳
View GitHub Profile
@andy-esch
andy-esch / odsc-east-mini-tutorial.md
Created March 6, 2019 13:59
Maps & Machine Learning: Maps & Machine Learning: Best Practices for Great Cartography in Data Science

ODSC East (Boston) - 2019

Making good maps in data science is hard. Maps are another form of data visualization with its own set of design principles to bring out the story in the data. Data scientists need for maps varies, but a very common use case is to quickly generate a data visualization iteratively to better understand model outputs, spatial variations in the data, and more.

In this mini-tutorial, I will cover best practices for data scientists needing maps -- ideas pulled from cartography and honed over the years working in the intersection of open source GIS and data science. Using open source tools, I will show how to make patterns more apparent, how to build interactive maps so that it is easier to explore data on larger and smaller scales, and some list some cartographic tips and tricks. The goal is that data viz with maps will be made easier so that you can think about your data science problems instead of worrying about visualizing data on a map.

@andy-esch
andy-esch / index.html
Created October 16, 2018 20:48
carto vl with legends for cartoframes
<!DOCTYPE html>
<html>
<head>
<title>CARTO VL + CARTOframes</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<!-- Include CARTO VL JS -->
<script src="https://cartodb.github.io/carto-vl/dist/carto-vl.js"></script>
<!-- Include Mapbox GL JS -->
<script src="https://cartodb-libs.global.ssl.fastly.net/mapbox-gl/v0.48.0-carto1/mapbox-gl.js"></script>
@andy-esch
andy-esch / branca experiments.ipynb
Created June 27, 2018 19:33
branca experiments
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andy-esch
andy-esch / index.html
Last active June 25, 2019 12:12
moran's i scatter plot
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
@andy-esch
andy-esch / do-geom-specification.sql
Created November 9, 2017 20:45
Prototype function for metadata-returning object for cartoframes data_discovery
with envelope as (
SELECT
ST_SetSRID(ST_Extent(the_geom), 4326) as env,
count(*)::int as cnt
FROM
eschbacher.mexican_states
),
numers as (
SELECT
unnest(Array['mx.inegi.entidad', 'mx.inegi.localidad_urbana_y_rural_amanzanada']::text[]) as geom_id,
@andy-esch
andy-esch / updates.py
Created October 25, 2017 20:25
prototype function / class from v0.0001 cartoframes
"""Class for updating a cartoframe postgres table"""
class SQL(object):
"""class for building queries for syncing"""
def __init__(self, cartoframe):
""""""
self.cframe = cartoframe
def add_cols(self):
"""prototype methods for add columns to table/dataframe"""
@andy-esch
andy-esch / sva-oct-19-2017.md
Created October 19, 2017 20:59
CARTO at SVA - Oct 19, 2017
@andy-esch
andy-esch / index.html
Last active March 15, 2017 15:55
cartoframes html asset
<!DOCTYPE html>
<html>
<head>
<title>cartoframes</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<!-- Map takes up full browser window -->
<style>
@andy-esch
andy-esch / NYC Data Sci -- Feb 7, 2017.md
Last active February 7, 2017 20:26
NYC Data Science Academy -- Feb 7, 2017
@andy-esch
andy-esch / make_query.py
Last active December 14, 2016 20:10
mortality data parsing
spans = ['1', '100+', '10-14', '1-4', '15-19', '20-24', '25-29', '30-34',
'35-39', '40-44', '45-49', '50-54', '55-59', '5-9', '60-64',
'65-69', '70-74', '75-79', '80-84', '85-89', '90-94', '95-99']
genders = ['Male', 'Female']
# max(deaths) FILTER (WHERE gender = 'Female' AND five_year_age_groups_code = '35-39') As women_35_39_deaths