Jovian
⭐️
Sign In

Course Project on EDA with Python

Analysis on Video Game Dataset

In [13]:
# Jovian Commit Essentials
# Please retain and execute this cell without modifying the contents for `jovian.commit` to work
!pip install jovian --upgrade -q
import jovian
jovian.utils.colab.set_colab_file_id('1lL8RZ3gBZKQOCrihICM0ZwhIr_sygtrG')
In [14]:
# Jovian Commit Essentials
# Please retain and execute this cell without modifying the contents for `jovian.commit` to work
!pip install jovian --upgrade -q
import jovian
jovian.utils.colab.set_colab_file_id('1oGwjXryw_WfZHVPnlD0Y4zJlnZBbMqDT')

Exploratory analysis on Video Games Sales data

This Project is to perform the analysis on the Video Games Sales dataset. Here we use various libraries of Python for visualization of Data. The Dataset which is Used in Project is from Kaggle (👈 Click to Download)

The Libraries I used in Project are:

To install all required libraries, run the following Command:

pip install matplotlib seaborn numpy pandas jovian --upgrade

Know About Data visualization:

The Data visualization is the graphic representation of data. It involves producing images that communicate relationships among the represented data to viewers. Visualizing data is an essential part of data analysis and machine learning. In this tutorial, we'll use Python libraries Matplotlib and Seaborn to learn and apply some popular data visualization techniques.


In [2]:
project_name = "analysis-on-videogames-sales-data"
In [18]:
!pip install jovian --upgrade -q
In [8]:
import jovian
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
%matplotlib inline
In [20]:
jovian.commit(project=project_name)
[jovian] Attempting to save notebook.. [jovian] Updating notebook "abubakkarsid415/analysis-on-videogames-sales-data" on https://jovian.ml/ [jovian] Uploading notebook.. [jovian] Capturing environment.. [jovian] Committed successfully! https://jovian.ml/abubakkarsid415/analysis-on-videogames-sales-data

Data Preparation and Cleaning

Here various modes of displaying dataset which is in CSV format

In [3]:
data = 'VideoGameSales.csv' #locate the CSV dataset in variable data
videogame_df = pd.read_csv(data) #read the data using pandas and store it in videogame_df variable
videogame_df #display the data (completely )
Out[3]:
In [79]:
videogame_df.shape #To display the shape of the data (rows, columns)
Out[79]:
(500, 11)
In [83]:
videogame_df.sort_values(by = ['Name']).head(30) #Display top 30 rows and Sort by 'Name' column
Out[83]:
In [61]:
videogame_df.head(10) #To display top 10 rows from the dataset
Out[61]:
In [55]:
videogame_df.tail(10) #Display 10 rows from bottom of dataframe
Out[55]:
In [75]:
videogame_df[50:60] #Display the rows in range from 51 to 60
Out[75]:
In [94]:
#Method 1 to print all column names
for col in videogame_df.columns:
    print(col)

#Method 2 to print all col names
list(videogame_df.columns) 
Rank Name Platform Year Genre Publisher NA_Sales EUR_Sales JAP_Sales IND_Sales Global_Sales
Out[94]:
['Rank',
 'Name',
 'Platform',
 'Year',
 'Genre',
 'Publisher',
 'NA_Sales',
 'EUR_Sales',
 'JAP_Sales',
 'IND_Sales',
 'Global_Sales']
In [84]:
x = videogame_df['Name'].unique() #using numpy.ndarray to find all Names but only UNIQUE.
print(x)
['Wii Sports' 'Super Mario Bros.' 'Mario Kart Wii' 'Wii Sports Resort' 'Pokemon Red/Pokemon Blue' 'Tetris' 'New Super Mario Bros.' 'Wii Play' 'New Super Mario Bros. Wii' 'Duck Hunt' 'Nintendogs' 'Mario Kart DS' 'Pokemon Gold/Pokemon Silver' 'Wii Fit' 'Wii Fit Plus' 'Kinect Adventures!' 'Grand Theft Auto V' 'Grand Theft Auto: San Andreas' 'Super Mario World' 'Brain Age: Train Your Brain in Minutes a Day' 'Pokemon Diamond/Pokemon Pearl' 'Super Mario Land' 'Super Mario Bros. 3' 'Grand Theft Auto: Vice City' 'Pokemon Ruby/Pokemon Sapphire' 'Pokemon Black/Pokemon White' 'Brain Age 2: More Training in Minutes a Day' 'Gran Turismo 3: A-Spec' 'Call of Duty: Modern Warfare 3' 'Pokémon Yellow: Special Pikachu Edition' 'Call of Duty: Black Ops' 'Pokemon X/Pokemon Y' 'Call of Duty: Black Ops 3' 'Call of Duty: Black Ops II' 'Call of Duty: Modern Warfare 2' 'Grand Theft Auto III' 'Super Smash Bros. Brawl' 'Animal Crossing: Wild World' 'Mario Kart 7' 'Halo 3' 'Pokemon HeartGold/Pokemon SoulSilver' 'Super Mario 64' 'Gran Turismo 4' 'Super Mario Galaxy' 'Pokemon Omega Ruby/Pokemon Alpha Sapphire' 'Super Mario Land 2: 6 Golden Coins' 'Grand Theft Auto IV' 'Gran Turismo' 'Super Mario 3D Land' 'Gran Turismo 5' 'Super Mario All-Stars' 'Pokemon FireRed/Pokemon LeafGreen' 'Just Dance 3' 'Call of Duty: Ghosts' 'Halo: Reach' 'Mario Kart 64' 'New Super Mario Bros. 2' 'Halo 4' 'Final Fantasy VII' 'Just Dance 2' 'Gran Turismo 2' 'Call of Duty 4: Modern Warfare' 'Donkey Kong Country' 'Minecraft' 'Animal Crossing: New Leaf' 'Mario Party DS' 'The Elder Scrolls V: Skyrim' 'Super Mario Kart' 'FIFA 16' 'Wii Party' 'Halo 2' 'Mario Party 8' 'Pokemon Black 2/Pokemon White 2' 'FIFA Soccer 13' 'The Sims 3' 'GoldenEye 007' 'Mario & Sonic at the Olympic Games' 'Final Fantasy X' 'Final Fantasy VIII' 'Pokémon Platinum Version' 'Pac-Man' 'Grand Theft Auto: Liberty City Stories' 'Super Mario Galaxy 2' 'Star Wars Battlefront (2015)' 'Call of Duty: Advanced Warfare' 'The Legend of Zelda: Ocarina of Time' 'Crash Bandicoot 2: Cortex Strikes Back' 'Super Mario Bros. 2' 'Super Smash Bros. for Wii U and 3DS' 'Call of Duty: World at War' 'Battlefield 3' 'The Legend of Zelda: Twilight Princess' 'Just Dance' 'Need for Speed Underground' 'Tekken 3' 'Crash Bandicoot 3: Warped' 'Super Smash Bros. Melee' 'Mario Kart 8' 'Fallout 4' 'Mario Kart: Double Dash!!' 'Just Dance 4' 'FIFA 14' 'Need for Speed Underground 2' 'Medal of Honor: Frontline' "Uncharted 3: Drake's Deception" 'Crash Bandicoot' 'Zumba Fitness' 'Gears of War 2' 'Uncharted 2: Among Thieves' 'FIFA 12' 'Big Brain Academy' 'Red Dead Redemption' 'FIFA 15' 'Donkey Kong Country Returns' 'The Legend of Zelda' "Assassin's Creed III" 'Halo: Combat Evolved' 'Pokémon Emerald Version' 'Kingdom Hearts' 'Pokémon Crystal Version' 'Halo 3: ODST' 'Super Mario Sunshine' 'Street Fighter II: The World Warrior' 'World of Warcraft' 'Driver' 'Kinect Sports' 'Gears of War 3' 'Gears of War' 'Metal Gear Solid 2: Sons of Liberty' 'Sonic the Hedgehog 2' 'Metal Gear Solid 4: Guns of the Patriots' 'Metal Gear Solid' 'The Last of Us' 'Final Fantasy XII' 'LittleBigPlanet' 'Dragon Quest IX: Sentinels of the Starry Skies' 'LEGO Star Wars: The Complete Saga' 'Resident Evil 2' 'Tekken 2' 'Cooking Mama' 'Destiny' "Assassin's Creed II" 'Super Smash Bros.' "Assassin's Creed" 'Batman: Arkham City' 'Forza Motorsport 3' 'Monster Hunter Freedom Unite' 'Super Mario Advance' 'Mario Kart: Super Circuit' 'Pokemon Stadium' 'Crash Bandicoot: The Wrath of Cortex' 'Final Fantasy XIII' 'Dr. Mario' 'Pokemon Pinball' 'Final Fantasy IX' 'Final Fantasy X-2' 'Donkey Kong 64' 'Professor Layton and the Curious Village' 'Tomb Raider II' 'Madden NFL 2004' 'Dragon Quest VIII: Journey of the Cursed King' 'Diablo III' 'New Super Mario Bros. U' 'Super Mario Land 3: Wario Land' 'The Legend of Zelda: Phantom Hourglass' "Donkey Kong Country 2: Diddy's Kong Quest" 'Tomodachi Life' 'Medal of Honor: Rising Sun' "Kirby's Dream Land" 'Fable III' 'Microsoft Flight Simulator' 'Guitar Hero II' 'Resident Evil 5' 'Grand Theft Auto: Vice City Stories' 'FIFA Soccer 11' 'Resident Evil' "Tony Hawk's Pro Skater" 'Warzone 2100' 'Spyro the Dragon' "Link's Crossbow Training" 'Guitar Hero III: Legends of Rock' 'Fallout 3' 'Pokemon Mystery Dungeon: Explorers of Time/Explorers of Darkness' "Uncharted: Drake's Fortune" 'Madden NFL 06' 'Diddy Kong Racing' 'Monster Hunter Freedom 3' 'God of War III' 'StarCraft II: Wings of Liberty' 'Crash Team Racing' 'FIFA 17' 'Driver 2' 'The Simpsons: Hit & Run' "Tony Hawk's Pro Skater 2" 'Animal Crossing: City Folk' 'The Lord of the Rings: The Two Towers' 'Forza Motorsport 4' 'Tomb Raider' 'The Legend of Zelda: A Link to the Past' 'The Legend of Zelda: The Wind Waker' 'Mario & Sonic at the Olympic Winter Games' "Luigi's Mansion: Dark Moon" 'Splatoon' 'Madden NFL 2005' 'Pitfall!' 'Madden NFL 07' 'Spider-Man: The Movie' 'Dragon Quest VII: Warriors of Eden' 'Uncharted: The Nathan Drake Collection' 'God of War' 'Nintendo Land' 'Michael Jackson: The Experience' "Tony Hawk's Pro Skater 3" 'Winning Eleven: Pro Evolution Soccer 2007' 'The Elder Scrolls IV: Oblivion' 'Zelda II: The Adventure of Link' 'Need for Speed: Most Wanted' 'Resistance: Fall of Man' 'Sonic the Hedgehog' 'Kingdom Hearts II' 'Asteroids' 'Fable II' 'Halo 5: Guardians' 'Super Mario 3D World' 'Batman: Arkham Asylum' "Assassin's Creed: Revelations" 'Namco Museum' 'Metal Gear Solid 3: Snake Eater' 'Daxter' 'Warcraft II: Tides of Darkness' 'FIFA Soccer 06' 'EyeToy Play' "Uncharted 4: A Thief's End" 'Gran Turismo 5 Prologue' 'Street Fighter IV' 'Teenage Mutant Ninja Turtles' 'Excitebike' 'Frogger' 'Madden NFL 2003' 'Watch Dogs' 'Half-Life' "Super Mario World 2: Yoshi's Island" 'FIFA Soccer 07' 'The Legend of Zelda: Skyward Sword' 'Street Fighter II Turbo' 'Carnival Games' 'World of Warcraft: The Burning Crusade' 'Fallout: New Vegas' 'God of War II' 'Forza Motorsport 2' 'World Soccer Winning Eleven 9' 'Namco Museum Vol.3' 'Tekken Tag Tournament' 'Far Cry 4' 'Star Fox 64' 'Golf' 'Professor Layton and the Diabolical Box' 'Left 4 Dead 2' 'Namco Museum: 50th Anniversary' 'EA Sports Active' "Assassin's Creed: Unity" 'Donkey Kong Land' "Tony Hawk's Underground" "Assassin's Creed IV: Black Flag" 'Monster Hunter 4 Ultimate' 'MotorStorm' 'Tekken 5' 'Dragon Warrior III' 'Sports Champions' 'NBA 2K16' 'World Soccer Winning Eleven 8 International' 'Flash Focus: Vision Training in Minutes a Day' 'Namco Museum Vol.1' "The Legend of Zelda: Link's Awakening" "Mario & Luigi: Bowser's Inside Story" 'Big Brain Academy: Wii Degree' 'Nintendogs + cats' 'Batman: Arkham Knight' 'Mario & Sonic at the London 2012 Olympic Games' 'LEGO Indiana Jones: The Original Adventures' "Resident Evil Director's Cut" 'Ratchet & Clank: Size Matters' 'Just Dance 2014' 'The Sims: Unleashed' 'Super Paper Mario' "Harry Potter and the Sorcerer's Stone" 'The Witcher 3: Wild Hunt' 'Resident Evil 3: Nemesis' 'Spyro: Year of the Dragon' 'FIFA Soccer 2005' 'Pokémon Trading Card Game' 'Battlefield 4' 'MySims' 'Friend Collection' "Tony Hawk's Pro Skater 4" 'Midnight Club 3: DUB Edition' 'Banjo-Kazooie' 'SOCOM: U.S. Navy SEALs' 'Guitar Hero: World Tour' 'Gran Turismo 6' 'Jak and Daxter: The Precursor Legacy' 'Pokemon Snap' 'FIFA Soccer 10' 'Pro Evolution Soccer 2008' 'Resident Evil 4' "Tom Clancy's The Division" 'Star Wars: Battlefront' 'Doom II: Hell on Earth' 'The Simpsons: Road Rage' 'Cooking Mama 2: Dinner With Friends' "Luigi's Mansion" 'Star Wars: Battlefront II' 'WWF SmackDown!' 'Croc: Legend of the Gobbos' 'The Getaway' 'Tomb Raider III: Adventures of Lara Croft' 'James Bond 007: Agent Under Fire' 'LEGO Star Wars: The Video Game' 'Rugrats in Paris: The Movie' "Spyro 2: Ripto's Rage!" 'Left 4 Dead' "Donkey Kong Country 3: Dixie Kong's Double Trouble!" "Assassin's Creed: Brotherhood" 'Kung Fu' 'Clubhouse Games' 'FIFA Soccer 2004' 'Battlefield: Bad Company 2' 'Guitar Hero: On Tour' 'Far Cry 3' 'Monster Hunter 4' 'Borderlands' 'Tekken 4' 'LittleBigPlanet 2' 'Grand Theft Auto 2' 'Final Fantasy III' 'Spider-Man 2' 'F-1 Race' 'FIFA Soccer 2003' 'Crash Bash' 'LEGO Batman: The Videogame' 'Metal Gear Solid V: The Phantom Pain' 'The Legend of Zelda: Spirit Tracks' 'WWF War Zone' "The Legend of Zelda: Majora's Mask" 'Professor Layton and the Unwound Future' 'Rugrats: Search For Reptar' 'English Training: Have Fun Improving Your Skills!' 'James Bond 007: Nightfire' 'Ratchet & Clank' 'Mario Party 9' 'Star Wars Episode III: Revenge of the Sith' 'Max Payne' 'The Lord of the Rings: The Return of the King' "Assassin's Creed Syndicate" 'True Crime: Streets of LA' 'Wii Music' 'Gran Turismo (PSP)' 'Monster Hunter X' 'Tekken' 'L.A. Noire' 'Madden NFL 16' 'Yokai Watch 2 Ganso/Honke' '007: Tomorrow Never Dies' 'Baseball' 'Killer Instinct' 'WWF SmackDown! 2: Know Your Role' 'Crisis Core: Final Fantasy VII' 'God of War: Chains of Olympus' 'Dragon Quest VI: Maboroshi no Daichi' 'Dance Central' 'Enter the Matrix' 'Super Mario Maker' 'Rhythm Heaven' 'Ace Combat 04: Shattered Skies' 'Club Penguin: Elite Penguin Force' 'Animal Crossing' 'Sonic Rush' 'Resident Evil 6' 'Halo: The Master Chief Collection' 'FIFA Soccer 08' 'Spider-Man' 'Need for Speed III: Hot Pursuit' 'Star Wars Episode I Racer' 'Personal Trainer: Cooking' 'Dragon Warrior IV' 'Heavy Rain' 'Mass Effect 2' 'Dragon Ball Z: Budokai' 'Madden NFL 2002' 'World Class Track Meet' 'Borderlands 2' 'The Legend of Zelda: A Link Between Worlds' 'Donkey Kong' 'The Sims: Vacation' 'Mass Effect 3' 'Kung Fu Panda' 'Epic Mickey' 'Saints Row 2' 'Rayman' 'Killzone 2' "Tom Clancy's Splinter Cell" "Mike Tyson's Punch-Out!!" 'WWE SmackDown! Shut Your Mouth' 'Gears of War: Ultimate Edition' 'NBA 2K13' 'Dragon Ball Z: Budokai Tenkaichi 3' 'wwe Smackdown vs. Raw 2006' 'Middle-Earth: Shadow of Mordor' 'Star Fox' 'The Sims: Livin Large' 'World Soccer Winning Eleven 6 International' 'Devil May Cry' 'Animal Crossing: Happy Home Designer' 'The Sims 4' 'Star Wars: The Old Republic' 'Sonic Heroes' 'Kirby Super Star Ultra' 'Hitman 2: Silent Assassin' 'Wave Race 64' 'SOCOM II: U.S. Navy SEALs' 'WWE SmackDown! vs. RAW 2006' 'inFAMOUS' 'Pac-Man Collection' 'Mass Effect' 'WarioWare: Smooth Moves' 'Cooking Mama: Cook Off' 'Titanfall' 'Sonic Mega Collection Plus' 'Sega Superstars Tennis' 'World Soccer Winning Eleven 7 International' 'Hot Shots Golf 3']
In [85]:
print('Total Games count(unique) :',len(x))
Total Games count(unique) : 431
In [118]:
import jovian
In [122]:
jovian.commit()
[jovian] Attempting to save notebook.. [jovian] Updating notebook "abubakkarsid415/analysis-on-videogames-sales-data" on https://jovian.ml/ [jovian] Uploading notebook.. [jovian] Capturing environment.. [jovian] Committed successfully! https://jovian.ml/abubakkarsid415/analysis-on-videogames-sales-data

Exploratory Analysis and Visualization

Now, to use Matplotlib library to visualize the Dataset.

In [67]:
vg_plot = videogame_df[0:25]
vg_plot
Out[67]:
In [83]:
x = vg_plot['Rank']
y = vg_plot['Year']
plt.plot(x,y, label = 'Year', color = 'green')
plt.xlabel('Rank')
plt.ylabel('Year')
plt.legend()
plt.show()
In [71]:
total = vg_plot['Global_Sales']
NA = vg_plot['NA_Sales']
EUR = vg_plot['EUR_Sales']
JAP = vg_plot['JAP_Sales']
IND = vg_plot['IND_Sales']
In [72]:
plt.grid(True)
plt.title('Comparision With all Countries with Global Sales')

plt.plot(total, label = 'Global')
plt.plot(NA, label = 'AMERICA')
plt.plot(EUR, label = 'EUROPE')
plt.plot(JAP, label = 'JAPAN')
plt.plot(IND, label = 'INDIA')
plt.legend(bbox_to_anchor =(1.6, 1.025), ncol = 2)
Out[72]:
<matplotlib.legend.Legend at 0x2430357f2e0>
In [213]:
max_games = videogame_df['Global_Sales']
top5_sellers = max_games.index.tolist()[:5]
top5_sellers
Out[213]:
[0, 1, 2, 3, 4]
In [80]:
kwargs = dict(histtype='stepfilled', alpha=0.3, bins=40)
plt.hist(total, **kwargs)
plt.hist(NA, **kwargs)
plt.hist(EUR, **kwargs)
plt.hist(JAP, **kwargs)
plt.hist(IND, **kwargs)
plt.title('Stepfield type of Comparision Global with all Countries')
Out[80]:
Text(0.5, 1.0, 'Stepfield type of Comparision Global with all Countries')
In [ ]:
 
In [86]:
import jovian
In [ ]:
jovian.commit()
[jovian] Attempting to save notebook..

Asking and Answering Questions

TODO

In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
import jovian
In [ ]:
jovian.commit()
[jovian] Attempting to save notebook.. [jovian] Updating notebook "aakashns/zerotopandas-course-project-starter" on https://jovian.ml/ [jovian] Uploading notebook.. [jovian] Capturing environment.. [jovian] Committed successfully! https://jovian.ml/aakashns/zerotopandas-course-project-starter

Inferences and Conclusion

TODO

In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
import jovian
In [ ]:
jovian.commit()
[jovian] Attempting to save notebook.. [jovian] Updating notebook "aakashns/zerotopandas-course-project-starter" on https://jovian.ml/ [jovian] Uploading notebook.. [jovian] Capturing environment.. [jovian] Committed successfully! https://jovian.ml/aakashns/zerotopandas-course-project-starter

References and Future Work

TODO

In [ ]:
import jovian
In [ ]:
jovian.commit()
[jovian] Attempting to save notebook..
In [ ]: