space-race-analysis
Space Race Analysis
A study of every space launch on record from 1957 to 2020: 4,324 of them, flown by 56 organisations. It answers the questions people actually ask about spaceflight: who launches the most, what a launch costs, and how the USA and the USSR compared during the Cold War. It ships 17 charts plus a web page where you filter by country, organisation, or years and watch them redraw.
Solo work by our founder, Salman Adnan.
Overview
A data analysis script and interactive Flask dashboard covering every space mission launch on record from the start of the Space Race in 1957 through 2020: 4,324 launches by 56 organisations, cleaned and turned into 17 static charts plus a live-filterable dashboard covering launch counts, cost, geography, and the Cold War rivalry between the USA and the USSR.
Raw launch logs answer "what happened" one row at a time. This project turns those rows into answers to the questions people actually ask about spaceflight history: who launches the most, what does a launch cost, and how did the USA and USSR compare during the Cold War. What started as a one-shot static analysis script grew a second life as a live Flask dashboard sitting on top of the same cleaned data.
Key features
- Cleans the scraped CSV: drops duplicate rows and two junk index columns, then parses free-text launch locations down to ISO country codes with a graceful fallback for defunct sites like former USSR launch pads.
- 17 static charts: bar charts for launches per organisation/year/month, a price histogram, line charts for average price and launch cadence over time, a USA vs USSR pie chart, and two interactive Plotly charts (a world choropleth and a country-to-organisation sunburst).
- Every chart writes to
output/as a file (PNG or HTML), so the analysis is reproducible headless; an optionalSHOW_PLOTS=1toggle pops each one up interactively too. - A spend analysis across the 25 organisations that report both launch counts and a non-zero price, since most of the dataset never discloses cost.
- A Flask dashboard on the same cleaned data: filter by organisation, country, and launch-year range and watch five charts, including a real hover/zoom/click choropleth and sunburst, update live with no page reload.
Verification
A verified run of space_race_analysis.py writes 17 chart files (15 PNGs, 2 HTMLs) into output/, which ships in the repo as a sample of a completed run. The dashboard loads all 4,324 launches on start, and its "USA vs USSR (1957-1991)" shortcut computes a real number on the fly: 1,876 launches split 111 NASA to 1,765 RVSN USSR, not a hardcoded figure.
Tech stack
A challenge worth noting
An early version built a launch-count column with value_counts().reset_index()['Organisation'], which in current pandas pulls the organisation names, not the counts, into that column. It didn't fail until later, when dividing price by that column threw a type error. The fix was to map counts back onto each row explicitly by key instead of relying on how reset_index() happens to name its output in a given pandas version. On the dashboard side, sending a filtered chart to the browser without a full reload needed json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder) rather than fig.to_html(), since the page calls Plotly.react on the existing chart with that JSON instead of replacing the whole document.