Skip to content

Instantly share code, notes, and snippets.

@TheNeuralBit
Last active November 27, 2022 06:04
Show Gist options
  • Save TheNeuralBit/64d8cc13050c9b5743281dcf66059de5 to your computer and use it in GitHub Desktop.
Save TheNeuralBit/64d8cc13050c9b5743281dcf66059de5 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/[email protected]/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