Created
February 12, 2022 20:42
-
-
Save florestankorp/0c2351958add21e351dfd96a01a13ba8 to your computer and use it in GitHub Desktop.
Data analysis of the most popular type of sport in sports-movies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sources: | |
* https://www.rollingstone.com/movies/movie-lists/best-sports-movies-rocky-rudy-71467/ | |
* https://www.vulture.com/article/best-sports-movies-ranked.html | |
* | |
* Combined and de-duplicated list from both sources, resulted in 62 movies | |
* Both documentary and feature films are included in this list... | |
* | |
* Is 'The Big Lebowski' really a bowling film? | |
* Are coaches movies their own genre? | |
* Is running also track and field? | |
*/ | |
const HORSE_RACING = 'HORSE_RACING'; | |
const BASEBALL = 'BASEBALL'; | |
const BASKETBALL = 'BASKETBALL'; | |
const RUNNING = 'RUNNING'; | |
const TRACK_AND_FIELD = 'TRACK_AND_FIELD'; | |
const ICE_HOCKEY = 'ICE_HOCKEY'; | |
const CAR_RACING = 'CAR_RACING'; | |
const FIGURE_SKATING = 'FIGURE_SKATING'; | |
const AMERICAN_FOOTBALL = 'AMERICAN_FOOTBALL'; | |
const BOXING = 'BOXING'; | |
const DODGEBALL = 'DODGEBALL'; | |
const SOCCER = 'SOCCER'; | |
const KARATE = 'KARATE'; | |
const GOLF = 'GOLF'; | |
const POOL_BILLIARD = 'POOL_BILLIARD'; | |
const RUGBY = 'RUGBY'; | |
const CYCLING = 'CYCLING'; | |
const WRESTLING = 'WRESTLING'; | |
const BOWLING = 'BOWLING'; | |
const SURFING = 'SURFING'; | |
const movies = { | |
Seabiscuit: HORSE_RACING, | |
'The Natural': BASEBALL, | |
'The Way Back': BASKETBALL, | |
'Without Limits': RUNNING, | |
'Personal Best': TRACK_AND_FIELD, | |
'Bang the Drum Slowly': BASEBALL, | |
Goon: ICE_HOCKEY, | |
Senna: CAR_RACING, | |
'I, Tonya': FIGURE_SKATING, | |
'The Longest Yard': AMERICAN_FOOTBALL, | |
'The Boxer': BOXING, | |
"White Men Can't Jump": BASKETBALL, | |
'Major League': BASEBALL, | |
Dodgeball: DODGEBALL, | |
'Talladega Nights': CAR_RACING, | |
Rudy: AMERICAN_FOOTBALL, | |
'Bend It Like Beckham': SOCCER, | |
'The Karate Kid': KARATE, | |
'Eight Men Out': BASEBALL, | |
'The Fighter': BOXING, | |
'Happy Gilmore': GOLF, | |
'The Color of Money': POOL_BILLIARD, | |
Creed: BOXING, | |
'The Bad News Bears': BASEBALL, | |
'Sugar ': BASEBALL, | |
Rush: CAR_RACING, | |
'Tin Cup': GOLF, | |
Caddyshack: GOLF, | |
Hoosiers: BASKETBALL, | |
'Love and Basketball': BASKETBALL, | |
Moneyball: BASEBALL, | |
'The Damned United': SOCCER, | |
Miracle: ICE_HOCKEY, | |
'Chariots of Fire': TRACK_AND_FIELD, | |
'He Got Game': BASKETBALL, | |
Murderball: RUGBY, | |
'When We Were Kings': BOXING, | |
'Field of Dreams': BASEBALL, | |
'Breaking Away': CYCLING, | |
'Million Dollar Baby': BOXING, | |
'Slap Shot': ICE_HOCKEY, | |
'A League of Their Own': BASEBALL, | |
Ali: BOXING, | |
'The Wrestler': WRESTLING, | |
'Pride of the Yankees': BASEBALL, | |
Foxcatcher: WRESTLING, | |
'Bull Durham': BASEBALL, | |
Rocky: BOXING, | |
'Raging Bull': BOXING, | |
'Hoop Dreams': BASKETBALL, | |
'No No: A Dockumentary': BASEBALL, | |
'Blue Chips': BASKETBALL, | |
'Any Given Sunday': AMERICAN_FOOTBALL, | |
'The Bingo Long Traveling All-Stars & Motor Kings': BASEBALL, | |
Victory: SOCCER, | |
'The Big Lebowski': BOWLING, | |
'North Dallas Forty': AMERICAN_FOOTBALL, | |
'The Endless Summer': SURFING, | |
'Fat City': BOXING, | |
'Friday Night Lights': AMERICAN_FOOTBALL, | |
}; | |
const counts = {}; | |
for (const type of Object.values(movies)) { | |
counts[type] = counts[type] ? counts[type] + 1 : 1; | |
} | |
console.log(counts); | |
// { | |
// BASEBALL: 13, | |
// BOXING: 9, | |
// BASKETBALL: 7, | |
// AMERICAN_FOOTBALL: 5, | |
// CAR_RACING: 3, | |
// GOLF: 3, | |
// ICE_HOCKEY: 3, | |
// SOCCER: 3, | |
// TRACK_AND_FIELD: 2, | |
// WRESTLING: 2, | |
// BOWLING: 1, | |
// CYCLING: 1, | |
// DODGEBALL: 1, | |
// FIGURE_SKATING: 1, | |
// HORSE_RACING: 1, | |
// KARATE: 1, | |
// POOL_BILLIARD: 1, | |
// RUGBY: 1, | |
// RUNNING: 1, | |
// SURFING: 1, | |
// }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment