主机游戏销售数据分析练习

  • 数据读取与预处理
  • 发行商角度
    • 排名前10各发行商发布游戏占比
  • 最受欢迎游戏发行商排名
  • 排名前10发行商发行游戏时间活跃度
  • 游戏角度
    • 各类型游戏占比
  • 地区角度
    • 各类型游戏于各地区受欢迎程度
  • 平台角度
    • 排名前10各平台游戏发行量 & 销售额(市场份额)
  • 时间角度
    • 各年份游戏销量 & 各年份游戏发行量
    • 每年各地区游戏销量

这份数据集是一张包含销量超过10万份的电视游戏清单,数据来自vgcharts.com

指标分析流程:

数据读取与预处理

import numpy as np
import pandas as pd
​
df = pd.read_csv(r'C:/Users/Administrator/Desktop/vgsales.csv')
df.head(10)


字段名解释:

Rank:排名

Name:游戏名

Platform:游戏发行平台

Year:发布时间

Genre:游戏类别

Publisher:发行商

NA_Sales:北美区销量(百万)

EU_Sales:欧洲区销量(百万)

JP_Sales:日本区销量(百万)

Other_Sales:其他区销量(百万)

Global_Sales:全球总销量(百万)

df.info()

# 缺失值处理
df.isnull().sum(axis = 0)


数据缺失值不多,直接删除缺失值所在行

df = df.dropna()
df.info()

# 数据类型转换
df['Year'] = df['Year'].astype('int')
df.info()

# 观察异常值并排除
np.unique(df['Year'])

df = df[df['Year'] != 2020]
np.unique(df['Year'])

发行商角度

排名前10各发行商发布游戏占比


df_publisher = df.pivot_table(index = 'Publisher',values = 'Name',aggfunc = {'Name':'count'})
df_publisher.rename(columns = {'Name':'amount'}, inplace = True)
top10_publisher = df_publisher.sort_values(by = 'amount', ascending = False)[:10]
top10_publisher


# 排名前10发行商
other_publisher_amount = df_publisher['amount'].count() - top10_publisher['amount'].count()
top10_publisher.reset_index(inplace = True)
top10_publisher

# 排名10以外的发行商
others_amount = {'Publisher':'others', 'amount':[other_publisher_amount]}
others = pd.DataFrame(others_amount)
others


top10_others = pd.DataFrame(columns = [‘Publisher’,‘amount’], index = [‘0’,‘1’])
top10_others.iloc[0,0] = ‘top10’
top10_others.iloc[0,1] = top10_publisher[‘amount’].sum()
top10_others.iloc[1,:] = others.iloc[0,:]
top10_others

绘制饼图,查看各发行商发行游戏数量占比


import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签
plt.rcParams['axes.unicode_minus']=False #用来正常显示负号
import warnings
warnings.filterwarnings("ignore")
​
fig = plt.figure(figsize = (15,15))
ax1 = fig.add_subplot(1, 2, 1)
plt.pie(top10_others['amount'], labels = top10_others['Publisher'], autopct = '%1.2f%%')
plt.title('发行量top10发行商所占市场份额图')
ax2 = fig.add_subplot(1, 2, 2)
plt.pie(top10_publisher['amount'], labels = top10_publisher['Publisher'], autopct = '%1.2f%%')
plt.title('发行量top10发行商份额图')

最受欢迎游戏发行商排名


most_popular_publisher = df.pivot_table(index = 'Publisher',values = 'Global_Sales',aggfunc = {'Global_Sales':'sum'})
most_popular_publisher.sort_values(by ='Global_Sales', ascending = False, inplace = True)
most_popular_publisher

# 最受欢迎排名前十
top10_popular = most_popular_publisher.iloc[:10,:]
top10_popular.reset_index(inplace = True)
others_sales = df['Global_Sales'].sum() - top10_popular['Global_Sales'].sum()
others_pop = {'Publisher':'others','Global_Sales':[others_sales]}
others_df_pop = pd.DataFrame(others_pop)
others_df_pop

top10_others_pop = pd.DataFrame(columns = ['Publisher','Global_Sales'],index = ['0','1'])
top10_others_pop.iloc[0,0] = 'top10'
top10_others_pop.iloc[0,1] = top10_popular['Global_Sales'].sum()
top10_others_pop.iloc[1,:] = others_df_pop.iloc[0,:]
top10_others_pop

fig2 = plt.figure(figsize = (15,15))
ax3 = fig2.add_subplot(1,2,1)
plt.pie(top10_others_pop['Global_Sales'], labels = top10_others_pop['Publisher'], autopct = '%1.2ff%%')
plt.title('最受欢迎top10的发行商所占市场份额图')
ax4 = fig2.add_subplot(1,2,2)
plt.pie(top10_popular['Global_Sales'], labels = top10_popular['Publisher'], autopct = '%1.2ff%%')
plt.title('最受欢迎top10份额占比图')

top10_ = pd.merge(top10_popular, top10_publisher,how = 'outer')
top10_['Sales_Amount_Rate'] = top10_['Global_Sales'] / top10_['amount']
top10_


经过两表外连接后,不难看出:

  • 游戏发行量top10与最受欢迎(销量高)发行商top10被相同十家巨头占据
  • 由Sales_Amount_Rate指标可知,任天堂虽然发行游戏数在top10中较为中庸,在全球范围内仍是最受欢迎的游戏发行商

排名前10发行商发行游戏时间活跃度

publisher_time_active = df.pivot_table(index = ['Publisher', 'Year'],values = 'Name',aggfunc = {'Name':'count'})
publisher_time_active.rename(columns = {'Name':'Amount'}, inplace = True)
pta = publisher_time_active.reset_index()
pta


# 列出最具竞争力的十家发行商
tmp10 = top10_publisher['Publisher'].values
tmp10


frame1 = pta.loc[pta['Publisher'] == 'Electronic Arts', :]
frame1.set_index('Year', inplace = True)
frame2 = pta.loc[pta['Publisher'] == 'Activision', :]
frame2.set_index('Year', inplace = True)
frame3 = pta.loc[pta['Publisher'] == 'Namco Bandai Games', :]
frame3.set_index('Year', inplace = True)
frame4 = pta.loc[pta['Publisher'] == 'Ubisoft', :]
frame4.set_index('Year', inplace = True)
frame5 = pta.loc[pta['Publisher'] == 'Konami Digital Entertainment', :]
frame5.set_index('Year', inplace = True)
frame6 = pta.loc[pta['Publisher'] == 'THQ', :]
frame6.set_index('Year', inplace = True)
frame7 = pta.loc[pta['Publisher'] == 'Nintendo', :]
frame7.set_index('Year', inplace = True)
frame8 = pta.loc[pta['Publisher'] == 'Sony Computer Entertainment', :]
frame8.set_index('Year', inplace = True)
frame9 = pta.loc[pta['Publisher'] == 'Sega', :]
frame9.set_index('Year', inplace = True)
frame10 = pta.loc[pta['Publisher'] == 'Take-Two Interactive', :]
frame10.set_index('Year', inplace = True)

frame1.plot()
plt.title('Electronic Arts发行游戏时间活跃度')
plt.axis([1980,2021,0,121])
# plt.xticks(range(1980, 2021,5))
# plt.yticks(range(0, 121, 20))
frame2.plot()
plt.title('Activision发行游戏时间活跃度')
plt.xticks(range(1980, 2021,5))
plt.yticks(range(0, 121, 20))
frame3.plot()
plt.title('Namco Bandai Games发行游戏时间活跃度')
plt.xticks(range(1980, 2021,5))
plt.yticks(range(0, 121, 20))
frame4.plot()
plt.title('Ubisoft发行游戏时间活跃度')
plt.xticks(range(1980, 2021,5))
plt.yticks(range(0, 121, 20))
frame5.plot()
plt.title('Konami Digital Entertainment发行游戏时间活跃度')
plt.xticks(range(1980, 2021,5))
plt.yticks(range(0, 121, 20))
frame6.plot()
plt.title('THQ发行游戏时间活跃度')
plt.xticks(range(1980, 2021,5))
plt.yticks(range(0, 121, 20))
frame7.plot()
plt.title('Nintendo发行游戏时间活跃度')
plt.xticks(range(1980, 2021,5))
plt.yticks(range(0, 121, 20))
frame8.plot()
plt.title('Sony Computer Entertainment发行游戏时间活跃度')
plt.xticks(range(1980, 2021,5))
plt.yticks(range(0, 121, 20))
frame9.plot()
plt.title('Sega发行游戏时间活跃度')
plt.xticks(range(1980, 2021,5))
plt.yticks(range(0, 121, 20))
frame10.plot()
plt.title('Take-Two Interactive发行游戏时间活跃度')
plt.xticks(range(1980, 2021,5))
plt.yticks(range(0, 121, 20))





从上图可知,排名前十的游戏发行商都是从上世纪就开始发行游戏的老牌发行商

从上世纪九十年代末到2015年的二十年左右时间里大部分发行商发行游戏数量出现钟形走势,可能在这段时间里用户对电视游戏的需求也开始增长并逐渐趋于饱和

游戏角度

各类型游戏占比

genre_of_game = df.pivot_table(index = 'Genre',values = ['Name', 'Global_Sales'],aggfunc = {'Name':'count','Global_Sales':'sum'})
genre_of_game.rename(columns = {'Name':'Amount'}, inplace = True)
genre_of_game.sort_values(by = ['Global_Sales','Amount'], ascending = False)

genre_of_game.plot()


如图可知,游戏类型数量与受欢迎程度呈现一定正相关性

卖的最好的动作类游戏与运动类游戏同时也是游戏数量最多的两类

平台游戏的销售量与数量十分接近,可以看出发行的单位游戏数量的类型中平台游戏的销售量会是最高的

地区角度

各类型游戏于各地区受欢迎程度

genre_area = df.pivot_table(index = 'Genre',values = ['NA_Sales','EU_Sales','JP_Sales','Other_Sales'],aggfunc = {'NA_Sales':'sum','EU_Sales':'sum','JP_Sales':'sum','Other_Sales':'sum'})
genre_area

genre_area.reset_index(inplace = True)
genre_area

add_up = {'Genre':'add_up','EU':[genre_area['EU_Sales'].sum()],'JP':[genre_area['JP_Sales'].sum()],'NA':[genre_area['NA_Sales'].sum()],'Other':[genre_area['Other_Sales'].sum()]}
add_up_df = pd.DataFrame(add_up)
add_up_df

# 归一化
for i in range(0,len(genre_area.iloc[:,0])):for j in range(1,len(genre_area.iloc[0,:])):genre_area.iloc[i, j] = genre_area.iloc[i, j] / add_up_df.iloc[0, j]
genre_area

genre_area.set_index('Genre').T.plot.barh(figsize = (12,4), stacked = True)

  • 欧洲区玩家最喜欢格斗、运动、射击类游戏,而对策略类游戏等兴趣较低,其他区域玩家与欧洲区偏好相仿
  • 北美区玩家与欧洲区喜好相仿,由于欧美文化也经常会放在一起讨论,个人认为所以游戏也可以理解为与文化差异息息相关
  • 日本区玩家对角色扮演游戏热爱程度最高,甚至拉出第二动作类游戏两倍之多,考虑到现实中日本的二次元、jk文化盛行,也许与此有关

平台角度

排名前10各平台游戏发行量 & 销售额(市场份额)

platform_df = df.pivot_table(index = 'Platform',values = ['Name','Global_Sales'],aggfunc = {'Name':'count','Global_Sales':'sum'})
platform_df.sort_values(by = ['Name','Global_Sales'], inplace = True, ascending = False)
platform_df

top10_platform = platform_df.iloc[:10,:]
top10_platform


排名前10的平台有任天堂的NDS、Wii、GBA,索尼的PS、PS2、PS3、PSP,微软的XB、X360和PC

由此可见主机游戏市场早已是三分天下

top10_platform.plot.bar()
plt.xticks(rotation = 45)
plt.title('排名前十各平台游戏发行量与销售额柱状图')


排名前10各平台中NDS和PS2的游戏发行数量遥遥领先,NDS、PS2、PS3、Wii、X360、PS这几个平台的市场份额并列最高,基本持平

时间角度

各年份游戏销量 & 各年份游戏发行量

year_sales = df.pivot_table(index = 'Year',values = ['Global_Sales', 'Name'],aggfunc = {'Global_Sales':'sum','Name':'count'})
year_sales

year_sales.plot(marker = '*')
plt.title('各年份游戏销量图')


由上图可知,从1980年代开始主机游戏销量震荡缓慢上涨,并在二十世纪初出现井喷式增长,最后在2010年左右剧烈下滑

初步分析与猜测:若不考虑数据源问题,2010年左右游戏市场趋于饱和,没有足够多有吸引力的新游戏上市,导致行业发展进入瓶颈期

每年各地区游戏销量

year_area_sales = df.pivot_table(index = 'Year',values = ['EU_Sales','JP_Sales','NA_Sales'],aggfunc = {'EU_Sales':'sum','JP_Sales':'sum','NA_Sales':'sum'})
year_area_sales

year_area_sales.plot(marker = '*')
plt.title('每年各地区的游戏销量折线图')

由上图可知,在主机游戏市场,北美区的销量基本上处于领先地位,日本区可能由于人口基数小的原因导致销量即使在2005-2010年的全球高速增长时期也表现一般

总结:

  • 从各类指标top10中可知,动作类型的游戏普遍受众度更高
  • 策略、解谜类型游戏的玩者较少
  • 个人认为游戏属于第三产业,数据中表现的形式是经济发达地区与游戏的销量等关系有直接关系

主机游戏销售数据分析练习相关推荐

  1. vgsales游戏销售数据分析

    分析目标 字段分析 Rank - Ranking of overall sales Name - The games name Platform - Platform of the games rel ...

  2. 电子游戏销售数据分析(基于Python+Tableau)

    1 项目简介 1.1 数据描述 (1)数据来源 本次分析所采用的数据来源于kaggle上的Video Game Sales数据集 ,该数据集通过爬虫从vgchartzwangz网站上获取,主要描述了全 ...

  3. 初创公司怎么做销售数据分析_为什么您的初创企业需要数据科学来解决这一危机...

    初创公司怎么做销售数据分析 The spread of coronavirus is delivering a massive blow to the global economy. The lock ...

  4. 解析|不懂销售数据分析,就是一笔糊涂账!

    数据时代,不主张所有人是数据分析师,但是对自己手头的工作,和业务数据,能会用数据分析的思维去发现问题,还是有点用处的.最直观的体现就数据报告! 今天我们就来谈谈别的,销售数据分析报告! 销售数据分析报 ...

  5. 2021年中国主机游戏市场规模达25.8亿元,同比增长22.27%[图]

    主机游戏,原名console game,又名电视游戏,包含掌机游戏和家用机游戏两部分.是一种用来娱乐的交互式多媒体.通常是指使用电视屏幕为显示器,在电视上执行家用主机的游戏.主机游戏通常都有不同的玩法 ...

  6. 被巨头们看上的主机游戏 未来机会在哪里?

    属于<超级马里奥>的时代一去不复返,但主机游戏的未来似乎才到来. 在美国,闲暇时间和家庭成员一起来一局主机游戏的情形十分常见,但是由于文化差异以及对游戏的接受度不同,我国家长始终将游戏视为 ...

  7. 次世代主机游戏战争打响,5G时代下索尼微软任天堂该何去何从?

    要说最近游戏界有什么轰动的大事件,那就一定要数索尼与微软这两大主机游戏巨头发布次世代游戏机,并且将先后于11月10日与12日进行发售.游戏机发布日期离得这么近,双方的火药味甚浓. 随着旧主机游戏时代已 ...

  8. Python网络爬虫实战:天猫胸罩销售数据分析

    本文实现一个非常有趣的项目,这个项目是关于胸罩销售数据分析的.是网络爬虫和数据分析的综合应用项目.本项目会从天猫抓取胸罩销售数据,并将这些数据保存到SQLite数据库中,然后对数据进行清洗,最后通过S ...

  9. 初创公司怎么做销售数据分析_初创公司与Faang公司的数据科学

    初创公司怎么做销售数据分析 介绍 (Introduction) In an increasingly technological world, data scientist and analyst r ...

最新文章

  1. 教你用Vue渐进式搭建聊天室,从JavaScript=TypeScript
  2. Python实现RGB和Lab颜色空间互转
  3. docker详细介绍
  4. python概述_Python-概述
  5. _Linux 的文件系统及文件缓存知识点整理
  6. Win10开启Administrator超级管理员账户
  7. Qt之QLocalSocket
  8. 贝佐斯正接受14小时训练 以为周二进行的首次太空飞行做准备
  9. Java关键字:final、default、transient
  10. 电子科大计算机2014级,电子科大-计算机-操作系统实验报告-2014级.docx
  11. android intent包装,Android 中的 Intent
  12. c语言输入一个字符 对其进行归类,计算机二级C语言改错题归类 - 图文
  13. tempdb相关文章
  14. 16g电脑内存有什么好处_电脑内存容量都是16GB, 买单根16G好还是双根8G好呢?
  15. 红帽子 linux 声卡驱动,RedHat Linux系统下安装ALSA驱动的方法
  16. SQL 分组求和+行转列
  17. 教学演示软件 模型十四 三维图象渲染模型
  18. 黄金矿工java实现
  19. 随笔-自控概率的大转盘抽奖
  20. IV油管套件和配件的全球与中国市场2022-2028年:技术、参与者、趋势、市场规模及占有率研究报告

热门文章

  1. MongoDB聚合语句
  2. 程序员下班为什么从来不关电脑?
  3. AD20填充铺铜有个别元件铺不满
  4. 修复WordPress可视化编辑器空白方法
  5. 顶级高手常用的16个思维模型
  6. 最短路径floyed算法python
  7. Win10内核之系统调用原理--从KPTI 缓解措施至内核函数
  8. C语言 n个人围成一圈,顺序排号。从第一个人开始报数(从1到3报数),凡报到3的人退出圈子,计算最后留下的是最初第几号人
  9. 关于原型交互设计文档的一些建议
  10. JPEG图像压缩原理与DCT离散余弦变换