Skip to content

Instantly share code, notes, and snippets.

View RobinL's full-sized avatar

Robin Linacre RobinL

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RobinL
RobinL / edges_data.json
Last active October 11, 2023 14:47
splink3_cluster_studio
This file has been truncated, but you can view the full file.
[{"tf_adjusted_match_prob":0.990110793,"match_probability":0.9733507932,"source_dataset_l":"synthentic_data","unique_id_l":"Q15990270-11","source_dataset_r":"synthentic_data","unique_id_r":"Q15990270-13","surname_std_l":"searle","surname_std_r":"searle","forename1_std_l":"william","forename1_std_r":"william","forename2_std_l":"george","forename2_std_r":"georgina","forename3_std_l":null,"forename3_std_r":null,"forename4_std_l":null,"forename4_std_r":null,"forename5_std_l":null,"forename5_std_r":null,"gamma_surname_std":3,"gamma_forename1_std":3,"gamma_forename2_std":1,"occupation_l":null,"occupation_r":null,"gamma_occupation":-1,"dob_l":"1829-01-04","dob_r":null,"gamma_dob":-1,"postcode_l":"SE4 1TS","postcode_r":null,"lat_lng_l":{"lat":51.463683,"long":-0.029905},"lat_lng_r":null,"birth_place_l":"Bexley","birth_place_r":"Bexley","gamma_custom_postcode_distance_comparison":2,"cluster_l":"Q15990270","cluster_r":"Q15990270","match_key":5,"commit_hash":"20feacc","version":"v01","input_datasets":"uk_citizens_max_gr
import requests
import json
import pandas as pd
from io import StringIO
import time
url = "https://api.beta.ons.gov.uk/v1/filters?submitted=true"
ages = range(0,90)
ages = [str(a) for a in ages]
years = [2015,2016,2017]
@RobinL
RobinL / get_data.py
Created February 9, 2019 16:16
Filter api example
import requests
import json
import pandas as pd
from io import StringIO
import time
url = "https://api.beta.ons.gov.uk/v1/filters?submitted=true"
post = {
"dataset": {
{"$schema": "https://vega.github.io/schema/vega/v3.0.json",
"width": 500,
"height": 600,
"autosize": "none",
"signals": [
{
"name": "translate0",
"update": "width / 2"
},
{
@RobinL
RobinL / random_tasks.py
Created July 14, 2018 08:41
DAG dynamically generating tasks
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2018,10,1),
{
"quoteResponse": {
"result": [
{
"currency": "USD",
"esgPopulated": false,
"exchange": "CCY",
"exchangeDataDelayedBy": 0,
"exchangeTimezoneName": "Europe/London",
"exchangeTimezoneShortName": "GMT",
@RobinL
RobinL / testschema.json
Last active February 24, 2018 09:37
testschema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "Metadata",
"description": "MoJ Data Catalogue Metadata",
"properties": {
"id": {
"type": "string",
"title": "The ID of this table. Unique identifier which enables a table's metadata to refer to another table using e.g. for a foreign key",
"examples": [
@RobinL
RobinL / add_pk_to_sqlite_table.py
Created November 17, 2017 09:14
Add a primary key to a sqlite table
import re
def get_create_table_string(tablename, connection):
sql = """
select * from sqlite_master where name = "{}" and type = "table"
""".format(tablename)
result = connection.execute(sql)
create_table_string = result.fetchmany()[0][4]
return create_table_string
@RobinL
RobinL / .block
Last active September 15, 2017 13:41
sankey experiment 2
license: mit