Skip to main content
100%

Get above/below .500 point differential for NBA teams.

✓ Published0🌍 Public
CCaged
Last edited Feb 9, 2014
Created on Feb 9, 2014

This example visualizes how NBA teams perform against opponents above and below the .500 win-percentage threshold, ranking teams by their point differential against sub-.500 teams across each season. The Ruby script queries a PostgreSQL database of game and team statistics, then computes average scoring margins for games versus winning and losing opponents, sorting teams by the spread between those two margins. It outputs a terminal table via the `terminal-table` gem and writes the same ranked data to CSV files. The code relies on raw SQL through the `pg` API to join game results, demonstrating a straightforward data-processing pipeline rather than interactive visualization.

AI-generated description

Similar vizzes