<jupyter_start><jupyter_text>Lab 06: Aggregate Analysis Sales Data From Video Game Sales <NAME>, 03/26/2018<jupyter_code>import pandas as pd
import numpy as np
from datetime import date
df = pd.read_csv('./vgsales.csv')
df.head(3)<jupyter_output><empty_output><jupyter_text>Which company is the most common video game publisher? Answer: Electronic Arts<jupyter_code>df['Publisher'].value_counts().head(1)<jupyter_output><empty_output><jupyter_text>What's the most common platform? Answer: DS<jupyter_code>df['Platform'].value_counts().head(1)<jupyter_output><empty_output><jupyter_text>What about the most common genre? Answer: Action<jupyter_code>df['Genre'].value_counts().head(1)<jupyter_output><empty_output><jupyter_text>What are the top 20 highest grossing games? Answer: See below<jupyter_code>ds = df[['Name', 'Global_Sales']].sort_values('Global_Sales', ascending = False)
ds.head(20)<jupyter_output><empty_output><jupyter_text>No. 5 For North American video game sales, what's the median? Answer: 0.08<jupyter_code>np.median(df['NA_Sales'])
df[df['NA_Sales'] == 0.08]<jupyter_output><empty_output><jupyter_text>No. 6 For the top-selling game of all time, how many standard deviations above/below the mean are its sales for North America? Answer:<jupyter_code>(df['NA_Sales'].head(1) - df['NA_Sales'].mean()) / df['NA_Sales'].std()<jupyter_output><empty_output><jupyter_text>No. 7 The Nintendo Wii seems to have outdone itself with games. How does its average number of sales compare with all of the other platforms?<jupyter_code>df[df['Platform'] == 'Wii'][['Platform', 'NA_Sales', 'EU_Sales', 'JP_Sales', 'Other_Sales', 'Global_Sales']].groupby(df.Platform).mean()
df[df['Platform'] != 'Wii'][['Platform', 'NA_Sales', 'EU_Sales', 'JP_Sales', 'Other_Sales', 'Global_Sales']].groupby(df.Platform).mean()<jupyter_output><empty_output><jupyter_text>No. 8 What is the name of game which achieved the highest sales in Japan? Answer: Pokemon Red/Pokemon Blue<jupyter_code>df.sort_values('JP_Sales', ascending=False).head(1)<jupyter_output><empty_output><jupyter_text>No. 9 What is the name of game which achieved the highest sales in Europe? Answer: Wii Sports<jupyter_code>df.sort_values('EU_Sales', ascending=False).head(1)<jupyter_output><empty_output><jupyter_text>No. 10 What is the top 10 newest released games from this video game sales data?<jupyter_code>df.sort_values('Year', ascending=False).head(10)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13824130879345603, 'fraction_numerical': 0.015541922290388548, 'mean_word_length': 8.902834008097166, 'pattern_counts': {'":': 0, '<': 46, '<?xml version=': 0, '>': 46, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '9491', 'license': 'MIT', 'n_tokens_mistral': 899, 'n_tokens_neox': 824, 'n_words': 194, 'path': 'vg-stats.ipynb', 'repo_name': 'seattlechem/data-science', 'size': '2448'}