Skip to content

Instantly share code, notes, and snippets.

@cavedave
Last active May 19, 2025 12:16
Show Gist options
  • Save cavedave/780d37ab288a117e29defab9b5a3f848 to your computer and use it in GitHub Desktop.
Save cavedave/780d37ab288a117e29defab9b5a3f848 to your computer and use it in GitHub Desktop.
lyric subject date subject2 birth_year death_year category
"Harry Truman" Harry S. Truman November 2, 1948 Harry S. Truman 1884.0 1972.0 Politics
"Doris Day" Doris Day June 25, 1948 Doris Day 1922.0 2019.0 Entertainment
"Red China" Proclamation of the People's Republic of China October 1, 1949
"Johnnie Ray" Johnnie Ray 1949 Johnnie Ray 1927.0 1990.0 Entertainment
"South Pacific" South Pacific (musical) April 7, 1949
"Walter Winchell" Walter Winchell 1950 Walter Winchell 1897.0 1972.0 Other
"Joe DiMaggio" Joe DiMaggio February 7, 1949 Joe DiMaggio 1914.0 1999.0 Sports
"Joe McCarthy" Joseph McCarthy February 9, 1950 Joe McCarthy 1908.0 1957.0 Politics
"Richard Nixon" Richard Nixon November 7, 1950 Richard Nixon 1913.0 1994.0 Politics
"Studebaker" Studebaker 1950
"Television" Golden Age of Television 1948
"North Korea" Korean War June 25, 1950
"South Korea" Korean War June 25, 1950
"Marilyn Monroe" Marilyn Monroe 1950 Marilyn Monroe 1926.0 1962.0 Entertainment
"Rosenbergs" Julius and Ethel Rosenberg April 5, 1951 Julius Rosenberg 1918.0 1953.0 Other
"Rosenbergs" Julius and Ethel Rosenberg April 5, 1951 Ethel Rosenberg 1915.0 1953.0 Other
"H-bomb" Hydrogen bomb January 1950
"Sugar Ray" Sugar Ray Robinson vs. Jake LaMotta February 14, 1951 Sugar Ray Robinson 1921.0 1989.0 Sports
"Panmunjom" Panmunjom August 1951
"Brando" Marlon Brando 1951 Marlon Brando 1924.0 2004.0 Entertainment
"The King and I" The King and I March 29, 1951
"The Catcher in the Rye" The Catcher in the Rye July 16, 1951
"Eisenhower" Dwight D. Eisenhower November 4, 1952 Dwight D. Eisenhower 1890.0 1969.0 Politics
"Vaccine" Salk polio vaccine July 2, 1952
"England’s got a new queen" Proclamation of accession of Elizabeth II February 6, 1952 Elizabeth II 1926.0 2022.0 Politics
"Marciano" Rocky Marciano September 23, 1952 Rocky Marciano 1923.0 1969.0 Sports
"Liberace" Liberace February 3, 1952 Liberace 1919.0 1987.0 Entertainment
"Santayana goodbye" George Santayana September 26, 1952 George Santayana 1863.0 1952.0 Other
"Joseph Stalin" Death of Joseph Stalin March 5, 1953 Joseph Stalin 1878.0 1953.0 Politics
"Malenkov" Georgy Malenkov March 6, 1953 Georgy Malenkov 1902.0 1988.0 Politics
"Nasser" Gamal Abdel Nasser July 23, 1952 Gamal Abdel Nasser 1918.0 1970.0 Politics
"Prokofiev" Sergei Prokofiev March 5, 1953 Sergei Prokofiev 1891.0 1953.0 Entertainment
"Rockefeller" Divorce between Winthrop Rockefeller and Barbara "Bobo" Sears[d] June 19, 1954 Winthrop Rockefeller 1912.0 1973.0 Politics
"Campanella" Roy Campanella November 27, 1953 Roy Campanella 1921.0 1993.0 Sports
"Communist Bloc" Communist Bloc June 17, 1953
"Roy Cohn" Roy Cohn July 1954 Roy Cohn 1927.0 1986.0 Other
"Juan Perón" Juan Perón September 19, 1955 Juan Perón 1895.0 1974.0 Politics
"Toscanini" Arturo Toscanini April 4, 1954 Arturo Toscanini 1867.0 1957.0 Entertainment
"Dacron" Dacron 1954
"Dien Bien Phu Falls" Battle of Dien Bien Phu May 7, 1954
"Rock Around the Clock" Rock Around the Clock April 12, 1954
"Einstein" Albert Einstein April 18, 1955 Albert Einstein 1879.0 1955.0 Other
"James Dean" James Dean September 30, 1955 James Dean 1931.0 1955.0 Entertainment
"Brooklyn’s got a winning team" Brooklyn Dodgers in the 1955 World Series October 4, 1955
"Davy Crockett" Davy Crockett: King of the Wild Frontier May 25, 1955
"Peter Pan" Peter Pan March 7, 1955
"Elvis Presley" Elvis Presley November 21, 1955 Elvis Presley 1935.0 1977.0 Entertainment
"Disneyland" Disneyland July 17, 1955
"Bardot" Brigitte Bardot November 28, 1956 Brigitte Bardot 1934.0 Entertainment
"Budapest" Hungarian Revolution of 1956 October 23, 1956
"Alabama" Montgomery bus boycott December 5, 1955
"Khrushchev" Nikita Khrushchev February 25, 1956 Nikita Khrushchev 1894.0 1971.0 Politics
"Princess Grace" Grace Kelly April 18, 1956 Grace Kelly 1929.0 1982.0 Entertainment
"Peyton Place" Peyton Place September 24, 1956
"Trouble in the Suez" Suez Crisis July 26, 1956
"Little Rock" Little Rock Crisis September 24, 1957
"Pasternak" Boris Pasternak November 23, 1957 Boris Pasternak 1890.0 1960.0 Entertainment
"Mickey Mantle" Mickey Mantle November 22, 1957 Mickey Mantle 1931.0 1995.0 Sports
"Kerouac" Jack Kerouac September 5, 1957 Jack Kerouac 1922.0 1969.0 Entertainment
"Sputnik" Sputnik 1 October 4, 1957
"Chou En-Lai" Zhou Enlai January 1957 Chou En-Lai 1898.0 1976.0 Politics
"Bridge on the River Kwai" The Bridge on the River Kwai October 2, 1957
"Lebanon" 1958 Lebanon crisis July 15, 1958
"Charles de Gaulle" Charles de Gaulle December 21, 1958 Charles de Gaulle 1890.0 1970.0 Politics
"California baseball" Major League Baseball relocations of 1950s–1960s 1958
"Starkweather homicide" Charles Starkweather January 21, 1958 Charles Starkweather 1938.0 1959.0 Other
"Children of Thalidomide" Thalidomide scandal 1958
"Buddy Holly" The Day the Music Died February 3, 1959 Buddy Holly 1936.0 1959.0 Entertainment
"Ben-Hur" Ben-Hur November 18, 1959
"Space monkey" Miss Baker May 28, 1959
"Mafia" Vito Genovese April 17, 1959 Vito Genovese 1897.0 1969.0 Other
"Hula hoops" Hula hoop 1959
"Castro" Fidel Castro February 16, 1959 Fidel Castro 1926.0 2016.0 Politics
"Edsel is a no-go" Edsel November 19, 1959
"U-2" 1960 U-2 incident May 1, 1960
"Syngman Rhee" Syngman Rhee March 15, 1960 Syngman Rhee 1875.0 1965.0 Politics
"Payola" Payola 1960
"Kennedy" John F. Kennedy November 8, 1960 John F. Kennedy 1917.0 1963.0 Politics
"Chubby Checker" Chubby Checker July 1960 Chubby Checker 1941.0 Entertainment
"Psycho" Psycho September 8, 1960
"Belgians in the Congo" Congo Crisis July 5, 1960 – November 25, 1965
"Hemingway" Ernest Hemingway July 2, 1961 Ernest Hemingway 1899.0 1961.0 Entertainment
"Eichmann" Adolf Eichmann June 1, 1962 Adolf Eichmann 1906.0 1962.0 Other
"Stranger in a Strange Land" Stranger in a Strange Land June 1, 1961
"Dylan" Bob Dylan Mar 19, 62 Bob Dylan 1941.0 Entertainment
"Berlin" Berlin Wall August 13, 1961
"Bay of Pigs Invasion" Bay of Pigs Invasion April 17–20, 1961
"Lawrence of Arabia" Lawrence of Arabia December 10, 1962
"British Beatlemania" Beatlemania c.1963 – 1966
"Ole Miss" Ole Miss riot of 1962 September 30 – October 1, 1962
"John Glenn" John Glenn February 20, 1962 John Glenn 1921.0 2016.0 Other
"Liston beats Patterson" Sonny Liston vs. Floyd Patterson II July 22, 1963
"Pope Paul" Pope Paul VI June 21, 1963 Pope Paul VI 1897.0 1978.0 Other
"Malcolm X" Malcolm X February 21, 1965 Malcolm X 1925.0 1965.0 Politics
"British politician sex" Profumo affair c. early 1960s
"JFK blown away" Assassination of John F. Kennedy November 22, 1963
"Birth control" Griswold v. Connecticut June 7, 1965
"Ho Chi Minh" Ho Chi Minh September 2, 1969 Ho Chi Minh 1890.0 1969.0 Politics
"Richard Nixon back again" Richard Nixon January 20, 1969
"Moonshot" Apollo 11 July 20, 1969
"Woodstock" Woodstock August 15–18, 1969
"Watergate" Watergate scandal June 17, 1972
"Punk rock" Punk rock c. mid-1970s
"Begin" Menachem Begin June 21, 1977 Menachem Begin 1913.0 1992.0 Politics
"Reagan" Ronald Reagan 1976 Ronald Reagan 1911.0 2004.0 Politics
"Palestine" Israeli–Palestinian conflict 1979 – 1990
"Terror on the airline" Attacks on aircraft by the Popular Front for the Liberation of Palestine 1968 – 1970
"Ayatollah's in Iran" Ruhollah Khomeini's return to Iran February 1, 1979 Ruhollah Musavi Khomeini 1902.0 1989.0 Politics
"Russians in Afghanistan" Soviet–Afghan War December 24, 1979
"Wheel of Fortune" Wheel of Fortune September 19, 1983
"Sally Ride" Sally Ride June 18, 1983 Sally Ride 1951.0 2012.0 Other
"Heavy metal suicide" Death of John Daniel McCollum October 27, 1984
"Foreign debts" National debt of the United States October 23, 1981
"Homeless vets" Homeless veterans in the United States After 1975
"AIDS" HIV/AIDS in the United States June 5, 1981
"Crack" Crack epidemic in the United States 1980s – 1990s
"Bernie Goetz" 1984 New York City Subway shooting December 22, 1984 Bernie Goetz 1947.0 Other
"Hypodermics on the shore" Syringe tide 1987 – 1988
"China's under martial law" People's Liberation Army at the 1989 Tiananmen Square protests and massacre May 21 – June 9, 1989
"Rock and roller Cola wars" Cola wars 1970s - 1980s
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime
from matplotlib.patches import Patch
# Load the dataset
combined = pd.read_csv("datesF2_with_category.csv")
# --- CLEANUP ---
# Normalize and fix category labels
combined['category'] = combined['category'].replace({
"Sports": "Sport",
"Books and Movies": "Entertainment"
}).str.strip()
combined['coarse_category'] = combined['category']
def normalize_date_string(date_str):
try:
if pd.isna(date_str):
return pd.NaT
date_str = str(date_str).strip()
if date_str.isdigit() and len(date_str) == 4:
return datetime.datetime.strptime(date_str + "-01-01", "%Y-%m-%d")
return pd.to_datetime(date_str, errors='coerce')
except:
return pd.NaT
combined['event_date'] = combined['date'].apply(normalize_date_string)
# Add manual extras
extra_events = {
"Richard Nixon": [datetime.datetime(1969, 1, 20)],
"John F. Kennedy": [datetime.datetime(1963, 11,22)]
}
combined['extra_event_dates'] = combined['subject2'].map(extra_events).where(
combined['subject2'].isin(extra_events), None
)
# Manual fix for Bob Dylan's album release
combined.loc[combined['subject2'] == 'Bob Dylan', 'event_date'] = pd.to_datetime("1962-03-19")
# Filter valid people
people_df = combined.dropna(subset=['birth_year'])
current_year = datetime.datetime.now().year
people_df['death_year'] = people_df['death_year'].fillna(current_year)
# --- COLORS ---
coarse_color_map = {
"Politics": "#1f77b4",
"Entertainment": "#ff7f0e",
"Sport": "#2ca02c",
"Other": "#7f7f7f"
}
# --- PLOT ---
# Adjust height dynamically
row_height = 0.35
num_people = len(people_df)
fig_height = max(10, row_height * num_people)
plt.figure(figsize=(14, fig_height))
for _, row in people_df.iterrows():
birth = int(row['birth_year'])
death = int(row['death_year'])
subject = row['subject2']
category = str(row['coarse_category']).strip()
y = subject
color = coarse_color_map.get(category, 'gray')
plt.hlines(y=y, xmin=birth, xmax=death, color=color, linewidth=4)
if pd.notna(row['event_date']):
year = row['event_date'].year
if birth <= year <= death:
plt.plot(year, y, 'o', color='black')
if isinstance(row['extra_event_dates'], list):
for extra_date in row['extra_event_dates']:
year = extra_date.year
if birth <= year <= death:
plt.plot(year, y, 'o', color='black')
# --- Labels and Legend ---
plt.axvline(x=1989, color='black', linestyle='--')
plt.text(1990, -1, "1989 (song release)", fontsize=10)
legend_elements = [
Patch(facecolor=color, edgecolor='none', label=label)
for label, color in coarse_color_map.items()
]
plt.legend(
handles=legend_elements,
title="Famous For",
bbox_to_anchor=(1.02, 1),
loc="upper left",
borderaxespad=0,
frameon=False
)
plt.tight_layout(rect=[0, 0, 0.85, 1]) # THEN:
plt.title("People in Billy Joel’s “We Didn’t Start the Fire”", fontsize=20, weight='bold', pad=20)
plt.text(0.5, 1.02, "Dot represents the time of event referenced in the lyrics",
ha='center', va='bottom', transform=plt.gca().transAxes, fontsize=12)
plt.figtext(0.23, 0.063, "Data Wikipedia by @iamreddave", ha="center", fontsize=9, style='italic', color="gray")
# Axes
plt.xlabel("Year")
plt.ylabel("Person")
plt.grid(axis='x', linestyle='--', alpha=0.5)
plt.yticks(fontsize=8)
plt.gca().invert_yaxis()
plt.xlim(left=1860, right=2025)
plt.axvline(x=2025, color='gray', linestyle='--', linewidth=1)
plt.subplots_adjust(top=0.92)
plt.savefig("lifespans_compact.png", dpi=300)
plt.show()
@cavedave
Copy link
Author

lifespans_with_events_by_category2

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