Skip to content

Instantly share code, notes, and snippets.

@hamilton
Forked from TheNeuralBit/README.md
Created March 29, 2019 04:37
Show Gist options
  • Save hamilton/a23640afd2b35cc4a653c0dd7736058f to your computer and use it in GitHub Desktop.
Save hamilton/a23640afd2b35cc4a653c0dd7736058f to your computer and use it in GitHub Desktop.
Scrabble Arrow

Scrabble Data in an Arrow file

538's data on 45 years of Scrabble games turned into an Arrow file

Usage:

$ python scrabble.py https://media.githubusercontent.com/media/fivethirtyeight/data/master/scrabble-games/scrabble_games.csv scrabble.arrow
<!DOCTYPE html>
<meta charset="utf-8">
<title>Apache Arrow minimal example</title>
<body>
<div id="output"></div>
<script src="https://unpkg.com/@apache-arrow/es2015-umd@0.3.1/Arrow.js"></script>
<script type="text/javascript">
let outputDiv = document.getElementById("output");
outputDiv.textContent = "loading...";
fetch("https://gist.githubusercontent.com/TheNeuralBit/64d8cc13050c9b5743281dcf66059de5/raw/c146baf28a8e78cfe982c6ab5015207c4cbd84e3/scrabble.arrow")
.then(response => response.arrayBuffer())
.then(buffer => {
const table = Arrow.Table.from([new Uint8Array(buffer)]);
outputDiv.textContent = `Loaded scrabble.arrow! It has ${table.length} rows and the following columns: ${table.schema.fields.map(f => f.name).join(",")}`;
});
</script>
</body>
This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment