Homework – Pandas In this homework, you will demonstrate proficiency in analysis using Pandas, reading and using Python library documentation, and incorporating data visualization with analysis with...

1 answer below »

Homework – Pandas


In this homework, you will demonstrate proficiency in analysis using Pandas, reading and using Python library documentation, and incorporating data visualization with analysis with Series and DataFrames. You may only import the following libraries for this homework: pandas, matplotlib, seaborn, and random. You may not import any other libraries.




Video Game Analysis


The data file for this assignment describes information about historical video game sales. Categorical information includes rank (in sales), title, platform (system), year of release, genre, publisher, and sales amount (in millions) for the regions of: North America, Europe, Japan, and Other Countries.




Keep in mind as the data sets are getting larger, your code efficiency becomes even more important.


You have been hired as a data analyst to work on the data provided. To do this, you will create a Jupyter Notebook that performs the following:




1. Load the data from the file into a data frame with the rank denoted as the index.


a. Print the total number of video games.


b. Print a data frame containing the top 15 video games with the highest rank, including all data known about them.


2. The total for global sales is missing, but you realize it would be helpful to provide insights. This is the sum of sales for all regions and other sales. Create and populate a new column in your data frame for global sales. Display a revised formatted table of data, including global sales, for the top 15 video games with the highest rank, including all data known about them.


3. Display descriptive statistics that include:


a. Total number of video games.


b. Global Sales: min, max, mean, median, and standard deviation.


c. Percentage of video games that earned at least $5,000,000 in global sales starting in the year 2000 or later.


4. Write a Python function with parameters of data frame, category, value, and a number that specifies the number of rows to display in the result. The category and value should have default values of 'None' and the number of rows (n) should have a default value of 10. n will specify the number of rows to display in the result. The function should return a data frame containing the top n rows of video games, based on global sales for a specific value in the category, only if both category and value are provided. If both category and value are not provided, the top n video games overall should be displayed.


5. Based on the previously created function, create well formatted tables for each of the following:


a. The top five overall sellers


b. The top ten Wii sellers


c. The top five selling puzzle games


d. The top ten selling games in the year 1990


6. (10 points) Create a linear correlation matrix between sales in each market (e.g. NA, EU, etc.) and global sales. List two observations after analyzing the data. Then, provide two inferences based on your observations.


7. Create two more linear correlation matrices between sales in each market (e.g. NA, EU, etc.) and global sales – the first for the year 2000 and the second for the year 2015. List two observations and one inference for each observation that you can make about the relationship between change in sales over the 15-year period.


8. You have done such a good job with the previous analyses, your boss has said to you: "Thank you for your analysis. The client is very happy, but wants to know what other insights we can gather from the data". You only have a short time between now and the client meeting. Load more data of your choice, create a visualization of your choice (must be something other than a bar chart), and make at least one inference from your analysis.






Format the Code using an appropriate level of markdown cells so that your analysis is fully explained at each step of what you have done.

Answered Same DayOct 22, 2021

Answer To: Homework – Pandas In this homework, you will demonstrate proficiency in analysis using Pandas,...

Abr Writing answered on Oct 26 2021
136 Votes
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Importing necessary libraries"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Question 1"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"data = pd.read_csv(\n",
" \"videogamesales.csv\",\n",
" index_col = \"Rank\",\n",
" encoding='latin-1'\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part (a)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"16598"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.shape[0]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part (b)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",

"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
NamePlatformYearGenrePublisherNA_SalesEU_SalesJP_SalesOther_Sales
Rank
16586Carmageddon 64N641999ActionVirgin Interactive0.010.000.000.0
16587Bust-A-Move 3000GC2003PuzzleUbisoft0.010.000.000.0
16588BreachPC2011ShooterDestineer0.010.000.000.0
16589Secret Files 2: Puritas CordisDS2009AdventureDeep Silver0.000.010.000.0
16590Mezase!! Tsuri Master DSDS2009SportsHudson Soft0.000.000.010.0
16591Mega Brain BoostDS2008PuzzleMajesco Entertainment0.010.000.000.0
16592Chou Ezaru wa Akai Hana: Koi wa Tsuki ni Shiru...PSV2016Actiondramatic create0.000.000.010.0
16593Eiyuu Densetsu: Sora no Kiseki Material Collec...PSP2007Role-PlayingFalcom Corporation0.000.000.010.0
16594Myst IV: RevelationPC2004AdventureUbisoft0.010.000.000.0
16595PlusheesDS2008SimulationDestineer0.010.000.000.0
16596Woody Woodpecker in Crazy Castle 5GBA2002PlatformKemco0.010.000.000.0
16597Men in Black II: Alien EscapeGC2003ShooterInfogrames0.010.000.000.0
16598SCORE International Baja 1000: The Official GamePS22008RacingActivision0.000.000.000.0
16599Know How 2DS2010Puzzle7G//AMES0.000.010.000.0
16600Spirits & SpellsGBA2003PlatformWanadoo0.010.000.000.0
\n",
"
"
],
"text/plain": [
" Name Platform Year \\\n",
"Rank \n",
"16586 Carmageddon 64 N64 1999 \n",
"16587 Bust-A-Move 3000 GC 2003 \n",
"16588 Breach PC 2011 \n",
"16589 Secret Files 2: Puritas Cordis DS 2009 \n",
"16590 Mezase!! Tsuri Master DS DS 2009 \n",
"16591 Mega Brain Boost DS 2008 \n",
"16592 Chou Ezaru wa Akai Hana: Koi wa Tsuki ni Shiru... PSV 2016 \n",
"16593 Eiyuu Densetsu: Sora no Kiseki Material Collec... PSP 2007 \n",
"16594 Myst IV: Revelation PC 2004 \n",
"16595 Plushees DS 2008 \n",
"16596 Woody Woodpecker in Crazy Castle 5 GBA 2002 \n",
"16597 Men in Black II: Alien Escape GC 2003 \n",
"16598 SCORE International Baja 1000: The Official Game PS2 2008 \n",
"16599 Know How 2 DS 2010 \n",
"16600 Spirits & Spells GBA 2003 \n",
"\n",
" Genre Publisher NA_Sales EU_Sales JP_Sales \\\n",
"Rank \n",
"16586 Action Virgin Interactive 0.01 0.00 0.00 \n",
"16587 Puzzle Ubisoft 0.01 0.00 0.00 \n",
"16588 Shooter Destineer 0.01 0.00 0.00 \n",
"16589 Adventure Deep Silver 0.00 0.01 0.00 \n",
"16590 Sports Hudson Soft 0.00 0.00 0.01 \n",
"16591 Puzzle Majesco Entertainment 0.01 0.00 0.00 \n",
"16592 Action dramatic create 0.00 0.00 0.01 \n",
"16593 Role-Playing Falcom Corporation 0.00 0.00 0.01 \n",
"16594 Adventure Ubisoft 0.01 0.00 0.00 \n",
"16595 Simulation Destineer 0.01 0.00 0.00 \n",
"16596 Platform Kemco 0.01 0.00 0.00 \n",
"16597 Shooter Infogrames 0.01 0.00 0.00 \n",
"16598 Racing Activision 0.00 0.00 0.00 \n",
"16599 Puzzle 7G//AMES 0.00 0.01 0.00 \n",
"16600 Platform Wanadoo 0.01 0.00 0.00 \n",
"\n",
" Other_Sales \n",
"Rank \n",
"16586 0.0 \n",
"16587 0.0 \n",
"16588 0.0 \n",
"16589 0.0 \n",
"16590 0.0 \n",
"16591 0.0 \n",
"16592 0.0 \n",
"16593 0.0 \n",
"16594 0.0 \n",
"16595 0.0 \n",
"16596 0.0 \n",
"16597 0.0 \n",
"16598 0.0 \n",
"16599 0.0 \n",
"16600 0.0 "
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.tail(15)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Question 2"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"data[\"Global_Sales\"] = data.NA_Sales + \\\n",
" data.EU_Sales + \\\n",
" data.JP_Sales + \\\n",
" data.Other_Sales"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
NamePlatformYearGenrePublisherNA_SalesEU_SalesJP_SalesOther_SalesGlobal_Sales
Rank
16586Carmageddon 64N641999ActionVirgin Interactive0.010.000.000.00.01
16587Bust-A-Move 3000GC2003PuzzleUbisoft0.010.000.000.00.01
16588BreachPC2011ShooterDestineer0.010.000.000.00.01
16589Secret Files 2: Puritas CordisDS2009AdventureDeep Silver0.000.010.000.00.01
16590Mezase!! Tsuri Master DSDS2009SportsHudson Soft0.000.000.010.00.01
16591Mega Brain BoostDS2008PuzzleMajesco Entertainment0.010.000.000.00.01
16592Chou Ezaru wa Akai Hana: Koi wa Tsuki ni Shiru...PSV2016Actiondramatic create0.000.000.010.00.01
16593Eiyuu Densetsu: Sora no Kiseki Material Collec...PSP2007Role-PlayingFalcom Corporation0.000.000.010.00.01
16594Myst IV: RevelationPC2004AdventureUbisoft0.010.000.000.00.01
16595PlusheesDS2008SimulationDestineer0.010.000.000.00.01
16596Woody Woodpecker in Crazy Castle 5GBA2002PlatformKemco0.010.000.000.00.01
16597Men in Black II: Alien EscapeGC2003ShooterInfogrames0.010.000.000.00.01
16598SCORE International Baja 1000: The Official GamePS22008RacingActivision0.000.000.000.00.00
16599Know How 2DS2010Puzzle7G//AMES0.000.010.000.00.01
16600Spirits & SpellsGBA2003PlatformWanadoo0.010.000.000.00.01
\n",
"
"
],
"text/plain": [
" Name Platform Year \\\n",
"Rank \n",
"16586 Carmageddon 64 N64 1999 \n",
"16587 Bust-A-Move 3000 GC 2003 \n",
"16588 Breach PC 2011 \n",
"16589 Secret Files 2: Puritas Cordis DS 2009 \n",
"16590 Mezase!! Tsuri Master DS DS 2009 \n",
"16591 Mega Brain Boost DS 2008 \n",
"16592 Chou Ezaru wa Akai Hana: Koi wa Tsuki ni Shiru... PSV 2016 \n",
"16593 Eiyuu Densetsu: Sora no Kiseki Material Collec... PSP 2007 \n",
"16594 Myst IV: Revelation PC 2004 \n",
"16595 Plushees DS 2008 \n",
"16596 Woody Woodpecker in Crazy Castle 5 GBA 2002 \n",
"16597 Men in Black II: Alien Escape GC 2003 \n",
"16598 SCORE International Baja 1000: The Official Game PS2 2008 \n",
"16599 Know How 2 DS 2010 \n",
"16600 Spirits & Spells GBA 2003 \n",
"\n",
" Genre Publisher NA_Sales EU_Sales JP_Sales \\\n",
"Rank \n",
"16586 Action Virgin Interactive 0.01 0.00 0.00 \n",
"16587 Puzzle Ubisoft 0.01 0.00 0.00 \n",
"16588 Shooter Destineer 0.01 0.00 0.00 \n",
"16589 Adventure Deep Silver 0.00 0.01 0.00 \n",
"16590 Sports Hudson Soft 0.00 0.00 0.01 \n",
"16591 Puzzle Majesco Entertainment 0.01 0.00 0.00 \n",
"16592 Action dramatic create 0.00 0.00 0.01 \n",
"16593 Role-Playing Falcom Corporation 0.00 0.00 0.01 \n",
"16594 Adventure Ubisoft 0.01 0.00 0.00 \n",
"16595 Simulation Destineer 0.01 0.00 0.00 \n",
"16596 Platform Kemco 0.01 0.00 0.00 \n",
"16597 Shooter Infogrames 0.01 0.00 0.00 \n",
"16598 Racing Activision 0.00 0.00 0.00 \n",
"16599 Puzzle 7G//AMES 0.00 0.01 0.00 \n",
"16600 Platform Wanadoo 0.01 0.00 0.00 \n",
"\n",
" Other_Sales Global_Sales \n",
"Rank \n",
"16586 0.0 0.01 \n",
"16587 0.0 0.01 \n",
"16588 0.0 0.01 \n",
"16589 0.0 0.01 \n",
"16590 0.0 0.01 \n",
"16591 0.0 0.01 \n",
"16592 0.0 0.01 \n",
"16593 0.0 0.01 \n",
"16594 0.0 0.01 \n",
"16595 0.0 0.01 \n",
"16596 0.0 0.01 \n",
"16597 0.0 0.01 \n",
"16598 0.0 0.00 \n",
"16599 0.0 0.01 \n",
"16600 0.0 0.01 "
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.tail(15)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Question 3"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part (a)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part (b)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
NA_SalesEU_SalesJP_SalesOther_SalesGlobal_Sales
count16598.00000016598.00000016598.00000016596.00000016596.000000
mean0.2646670.1466590.0777740.0480690.537222
std0.8166830.5053500.3092920.1885991.555236
min0.0000000.0000000.0000000.0000000.000000
25%0.0000000.0000000.0000000.0000000.060000
50%0.0800000.0200000.0000000.0100000.170000
75%0.2400000.1100000.0400000.0400000.472500
max41.49000029.02000010.22000010.57000082.740000
\n",
"
"
],
"text/plain": [
" NA_Sales EU_Sales JP_Sales Other_Sales Global_Sales\n",
"count 16598.000000 16598.000000 16598.000000 16596.000000 16596.000000\n",
"mean 0.264667 0.146659 0.077774 0.048069 0.537222\n",
"std 0.816683 0.505350 0.309292 0.188599 1.555236\n",
"min 0.000000 0.000000 0.000000 0.000000 0.000000\n",
"25% 0.000000 0.000000 0.000000 0.000000 0.060000\n",
"50% 0.080000 0.020000 0.000000 0.010000 0.170000\n",
"75% 0.240000 0.110000 0.040000 0.040000 0.472500\n",
"max 41.490000 29.020000 10.220000 10.570000 82.740000"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.describe()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part (c)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.9515624040763705 %\n"
]
}
],
"source": [
"data.dropna(inplace=True)\n",
"\n",
"data = data[list(data.Year != \"Adventure\")]\n",
"data.Year = data.Year.astype(int)\n",
"\n",
"data_2000 = data[list(data.Year >= 2000)]\n",
"print(sum(data_2000.Global_Sales >= 5)/data.shape[0]*100, \"%\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Question 4"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"def func(parameters, category=None, value=None, num=10):\n",
" if parameters == {}:\n",
" if category==None:\n",
" return data.sort_values(\n",
" \"Global_Sales\",\n",
" ascending=False\n",
" ).iloc[:num]\n",
" else:\n",
" return data[data.Genre==category].sort_values(\n",
" \"Global_Sales\",\n",
" ascending=False\n",
" ).iloc[:num]\n",
" else:\n",
" if category==None:\n",
" return data[data.Year == parameters[\"Year\"]].sort_values(\n",
" \"Global_Sales\",\n",
" ascending=False\n",
" ).iloc[:num]\n",
" else:\n",
" return data[data.Genre==category]\\\n",
" [data.Year == parameters[\"Year\"]].sort_values(\n",
" \"Global_Sales\",\n",
" ascending=False\n",
" ).iloc[:num]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Question 5"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part (a)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
NamePlatformYearGenrePublisherNA_SalesEU_SalesJP_SalesOther_SalesGlobal_Sales
Rank
1Wii SportsWii2006SportsNintendo41.4929.023.778.4682.74
2Super Mario Bros.NES1985PlatformNintendo29.083.586.810.7740.24
3Mario Kart WiiWii2008RacingNintendo15.8512.883.793.3135.83
4Wii Sports ResortWii2009SportsNintendo15.7511.013.282.9633.00
5Pokemon Red/Pokemon BlueGB1996Role-PlayingNintendo11.278.8910.221.0031.38
\n",
"
"
],
"text/plain": [
" Name Platform Year Genre Publisher \\\n",
"Rank \n",
"1 Wii Sports Wii 2006 Sports Nintendo \n",
"2 Super Mario Bros. NES 1985 Platform Nintendo \n",
"3 Mario Kart Wii Wii 2008 Racing Nintendo \n",
"4 Wii Sports Resort Wii 2009 Sports Nintendo \n",
"5 Pokemon Red/Pokemon Blue GB 1996 Role-Playing Nintendo \n",
"\n",
" NA_Sales EU_Sales JP_Sales Other_Sales Global_Sales \n",
"Rank \n",
"1 41.49 29.02 3.77 8.46 82.74 \n",
"2 29.08 3.58 6.81 0.77 40.24 \n",
"3 15.85 12.88 3.79 3.31 35.83 \n",
"4 15.75 11.01 3.28 2.96 33.00 \n",
"5 11.27 8.89 10.22 1.00 31.38 "
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"func({}, num=5)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part (b)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
NamePlatformYearGenrePublisherNA_SalesEU_SalesJP_SalesOther_SalesGlobal_Sales
Rank
1Wii SportsWii2006SportsNintendo41.4929.023.778.4682.74
2Super Mario Bros.NES1985PlatformNintendo29.083.586.810.7740.24
3Mario Kart WiiWii2008RacingNintendo15.8512.883.793.3135.83
4Wii Sports ResortWii2009SportsNintendo15.7511.013.282.9633.00
5Pokemon Red/Pokemon BlueGB1996Role-PlayingNintendo11.278.8910.221.0031.38
6TetrisGB1989PuzzleNintendo23.202.264.220.5830.26
7New Super Mario Bros.DS2006PlatformNintendo11.389.236.502.9030.01
8Wii PlayWii2006MiscNintendo14.039.202.932.8529.01
9New Super Mario Bros. WiiWii2009PlatformNintendo14.597.064.702.2628.61
10Duck HuntNES1984ShooterNintendo26.930.630.280.4728.31
\n",
"
"
],
"text/plain": [
" Name Platform Year Genre Publisher \\\n",
"Rank \n",
"1 Wii Sports Wii 2006 Sports Nintendo \n",
"2 Super Mario Bros. NES 1985 Platform Nintendo \n",
"3 Mario Kart Wii Wii 2008 Racing Nintendo \n",
"4 Wii Sports Resort Wii 2009 Sports Nintendo \n",
"5 Pokemon Red/Pokemon Blue GB 1996 Role-Playing Nintendo \n",
"6 Tetris GB 1989 Puzzle Nintendo \n",
"7 New Super Mario Bros. DS 2006 Platform Nintendo \n",
"8 Wii Play Wii 2006 Misc Nintendo \n",
"9 New Super Mario Bros. Wii Wii 2009 Platform Nintendo \n",
"10 Duck Hunt NES 1984 Shooter Nintendo \n",
"\n",
" NA_Sales EU_Sales JP_Sales Other_Sales Global_Sales \n",
"Rank \n",
"1 41.49 29.02 3.77 8.46 82.74 \n",
"2 29.08 3.58 6.81 0.77 40.24 \n",
"3 15.85 12.88 3.79 3.31 35.83 \n",
"4 15.75 11.01 3.28 2.96 33.00 \n",
"5 11.27 8.89 10.22 1.00 31.38 \n",
"6 23.20 2.26 4.22 0.58 30.26 \n",
"7 11.38 9.23 6.50 2.90 30.01 \n",
"8 14.03 9.20 2.93 2.85 29.01 \n",
"9 14.59 7.06 4.70 2.26 28.61 \n",
"10 26.93 0.63 0.28 0.47 28.31 "
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"func({})"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Part (c)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
" ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here
NamePlatformYearGenrePublisherNA_SalesEU_SalesJP_SalesOther_SalesGlobal_Sales
Rank
6TetrisGB1989PuzzleNintendo23.202.264.220.5830.26
28Brain Age 2: More Training in Minutes a DayDS2005PuzzleNintendo3.445.365.321.1815.30
90Pac-Man26001982PuzzleAtari7.280.450.000.087.81