Skip to content

Instantly share code, notes, and snippets.

Avatar

spiker830

View GitHub Profile
@spiker830
spiker830 / us_preamble_similarity_matrix.json
Last active Mar 9, 2020
TF-IDF document similarity matrix comparing the preambles of the US state constitutions. Method discussed at http://investingdeeply.com/blog/tf-idf-document-similarity-state-preambles/
View us_preamble_similarity_matrix.json
[
[
1.0,
0.2330767830582499,
0.3580449463374264,
0.33104457161464773,
0.30990506110472205,
0.30873798523027984,
0.23994100496376014,
0.14688136622463122,
@spiker830
spiker830 / us_preambles.json
Last active Mar 9, 2020
Preambles for each US state constitution (some have no preamble indicated by empty string). Used in TF-IDF article: http://investingdeeply.com/blog/tf-idf-document-similarity-state-preambles/
View us_preambles.json
[
{
"state_name": "Alabama",
"state_id": "AL",
"preamble": "We the people of the State of Alabama, invoking the favor and guidance of Almighty God, do ordain and establish the following Constitution."
},
{
"state_name": "Alaska",
"state_id": "AK",
"preamble": "We the people of Alaska, grateful to God and to those who founded our nation and pioneered this great land, in order to secure and transmit to succeeding generations our heritage of political, civil, and religious liberty within the Union of States, do ordain and establish this constitution for the State of Alaska."
View us_features.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@spiker830
spiker830 / europe_features.json
Created Apr 3, 2020
GeoJSON of country outlines of Europe. Low resolution. Used for map at http://investingdeeply.com/blog/basic-maps-with-d3/
View europe_features.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@spiker830
spiker830 / covid_deaths.json
Last active Apr 12, 2020
JSON of total Covid-19 deaths from Jan 23 to Apr 10. Used for visualization at http://investingdeeply.com/blog/bar-chart-d3-vue/
View covid_deaths.json
[
{
"date":"Jan 23",
"total_deaths":25
},
{
"date":"Jan 24",
"total_deaths":41
},
{
@spiker830
spiker830 / covid_cases_us_07-24-2020.json
Last active Jul 25, 2020
Covid-19 per state case/death data for July 24th (from Johns Hopkins) along with state population estimates (from US Census Bureau). Used for the visualization described here: https://investingdeeply.com/blog/animated-horizontal-bar-chart-d3/
View covid_cases_us_07-24-2020.json
[
{
"state":"Alabama",
"cases":76005,
"deaths":1438,
"population":4908620
},
{
"state":"Alaska",
"cases":2249,
@spiker830
spiker830 / us_state_population_estimates_2017_lookup.json
Created Aug 2, 2020
JSON object of state names to population. Source: https://worldpopulationreview.com/states (from US Census Bureau's 2017 population estimates)
View us_state_population_estimates_2017_lookup.json
{
"Alabama":4908620,
"Alaska":734002,
"Arizona":7378490,
"Arkansas":3039000,
"California":39937500,
"Colorado":5845530,
"Connecticut":3563080,
"Delaware":982895,
"District of Columbia":720687,
@spiker830
spiker830 / 2019-county-population-estimates.csv
Created Aug 8, 2020
2019 county level population estimates, just the population estimate. From US Census Bureau: https://www.census.gov/data/tables/time-series/demo/popest/2010s-counties-total.html
View 2019-county-population-estimates.csv
STATE COUNTY STNAME CTYNAME POPESTIMATE2019
1 0 Alabama Alabama 4903185
1 1 Alabama Autauga County 55869
1 3 Alabama Baldwin County 223234
1 5 Alabama Barbour County 24686
1 7 Alabama Bibb County 22394
1 9 Alabama Blount County 57826
1 11 Alabama Bullock County 10101
1 13 Alabama Butler County 19448
1 15 Alabama Calhoun County 113605
@spiker830
spiker830 / federal_hill_sales.json
Last active Apr 24, 2021
JSON of the average sale price for properties in the Federal Hill neighborhood of Baltimore, MD. Each data point is the average price within a lat long square. Used for heatmap at http://investingdeeply.com/blog/heatmaps-leaflet-heatmap-js/
View federal_hill_sales.json
[
{
"lat":"39.2705",
"lng":"-76.6165",
"price":120000
},
{
"lat":"39.2705",
"lng":"-76.6155",
"price":234500