电子游戏销售数据可视化分析及预测

该博客围绕全球电子游戏销售数据展开,先进行数据可视化,查看各字段数量、找出最畅销游戏、清洗数据,绘制销售变化折线图和类型与销售额比较图;接着进行销售预测,包括编码、划分训练集测试集,用SVR模型预测并可视化结果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

对全球电子游戏销售数据进行可视化展示,并使用支持向量回归进行预测分析

数据可视化部分

In [1]:

import numpy as np 
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

In [20]:

df = pd.read_csv("/home/mw/input/games6014/games_utf8.csv")

In [9]:

df.head(5)

Out[9]:

index Name Platform Year_of_Release Genre Publisher NA_Sales EU_Sales JP_Sales Other_Sales Global_Sales Critic_Score Critic_Count User_Score User_Count Developer Rating
0 0 Wii Sports Wii 2006 Sports Nintendo 41.36 28.96 3.77 8.45 82.53 76.0 51.0 8 322.0 Nintendo E
1 1 Super Mario Bros. NES 1985 Platform Nintendo 29.08 3.58 6.81 0.77 40.24 NaN NaN NaN NaN NaN NaN
2 2 Mario Kart Wii Wii 2008 Racing Nintendo 15.68 12.76 3.79 3.29 35.52 82.0 73.0 8.3 709.0 Nintendo E
3 3 Wii Sports Resort Wii 2009 Sports Nintendo 15.61 10.93 3.28 2.95 32.77 80.0 73.0 8 192.0 Nintendo E
4 4 Pokemon Red/Pokemon Blue GB 1996 Role-Playing Nintendo 11.27 8.89 10.22 1.00 31.37 NaN NaN NaN NaN NaN NaN

In [10]:

df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 16928 entries, 0 to 16927
Data columns (total 17 columns):
index              16928 non-null int64
Name               16926 non-null object
Platform           16928 non-null object
Year_of_Release    16655 non-null object
Genre              16926 non-null object
Publisher          16873 non-null object
NA_Sales           16928 non-null float64
EU_Sales           16928 non-null float64
JP_Sales           16928 non-null float64
Other_Sales        16928 non-null float64
Global_Sales       16926 non-null float64
Critic_Score       8260 non-null float64
Critic_Count       8260 non-null float64
User_Score         10159 non-null object
User_Count         7718 non-null float64
Developer          10240 non-null object
Rating             10092 non-null object
dtypes: float64(8), int64(1), object(8)
memory usage: 2.2+ MB

查看各个字段不同数量

可以看到有
有16928条销售信息
有11562个不同的游戏
有33个不同的游戏平台

In [11]:

df.nunique()

Out[11]:

index              16928
Name               11562
Platform              33
Year_of_Release       40
Genre                 14
Publisher            582
NA_Sales             402
EU_Sales             307
JP_Sales             244
Other_Sales          155
Global_Sales         629
Critic_Score          82
Critic_Count         106
User_Score            96
User_Count           888
Developer           1696
Rating                 8
dtype: int64

最畅销的游戏

在将不同平台上的相同游戏分组后,以下是前 5 名最畅销的游戏及其以百万计的销售数量。

In [13]:

df.groupby('Name')['Global_Sales'].sum().sort_values(ascending=False).head()

Out[13]:

Name
Wii Sports            82.53
Grand Theft Auto V
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

暴躁的秋秋

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值