问题

欧洲杯刚刚结束,就像看看有没有欧洲杯的数,分析下谁是本次欧洲杯表现最好的球员。于是我就上网找了一组数据。

网盘地址(提取码:hc9s)

【1】文件结构

【2】数据空处理

import numpy as np
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
import matplotlib.pyplot as plt
import seaborn as snsdf = pd.read_csv("./data/euro2020.csv")
print(df.head(10))summary = pd.DataFrame(df.dtypes, columns=["datatype"])
summary["isnull"] = df.isnull().sum()
summary["unique"] = df.nunique()
summary["first"] = df.loc[0]
summary["second"] = df.loc[1]
summary["third"] = df.loc[2]
print(summary)print(len(df))
train_df = df.drop("Blocks", axis = 1)train_df = train_df.fillna(axis = 0, value = 0)print(train_df.columns)

输出数据列

Index(['Player', 'Country', 'Position', 'Match played', 'Goals','Right foot goals', 'Left foot goals', 'Header goals', 'Assists','Total attempts', 'On target', 'Off target', 'Woodwork', 'Shot blocks','Avg gpg', 'Fouls suffered', 'Fouls committed', 'Top speed','Passing accuracy', 'Distance covered', 'Clearence attempted','Balls recovered', 'Tackels', 'Yellow cards', 'Red cards','Minutes played'],dtype='object')

字段分析下

# Player :球员
# Country :国家
# Position :所处位置
# Match played :出场场次
# Goals :进球数
# Right foot goals :右脚进球数
# Left foot goals :左脚进球数
# Header goals :头球进球数
# Assists :助攻数
# Total attempts :总射门数
# On target :球门内
# Off target :球门外
# Woodwork :球门框上
# Shot blocks :拦截
# Avg gpg :场均得分
# Fouls suffered :被犯规数
# Fouls committed :犯规数
# Top speed :最高速度
# Passing accuracy :传球准确度
# Distance covered :奔跑距离
# Balls recovered :抢断
# Tackles :铲球
# Yellow cards :黄牌数
# Red cards :红牌数
# Minutes played :上场时长

【3】整体数据集分布

fig, ax = plt.subplots(13,2, figsize=(100,300))
for idx, col in enumerate(train_df.columns.to_list()):row_idx = idx//2col_idx = idx%2sns.countplot(data=train_df, x = col,  color = "red", ax = ax[row_idx, col_idx])
plt.show()

【4】处理自己需要的数据

top_players = train_df.sort_values(["Goals"], ascending=False).iloc[:10]
train_df["gpa"] = train_df["Goals"]/train_df["Total attempts"]
attempts = train_df.sort_values(["gpa"], ascending=False).iloc[:10]
agp = train_df.sort_values(["Avg gpg"], ascending=False).iloc[:10]
passing_accuracy = train_df.sort_values(["Passing accuracy"], ascending=False).iloc[:10]
header = train_df.sort_values(["Header goals"], ascending=False).iloc[:10]

【5】总进球数

# 进球数排名top10
plt.figure(figsize=(20,5))
sns.barplot(x = "Player", data = top_players, y = "Goals", palette = "Greys", hue = "Position")
plt.title("Top players on the basis of max goals")
plt.show()

# 场均进球排名top10
fig, ax = plt.subplots(2, 1,figsize=(20,10))
sns.barplot(x = "Player", data = agp, y = "Avg gpg", palette = "Greys", ax = ax[0])
sns.barplot(x = "Country", data = agp, y = "Avg gpg", palette = "Greens", ax = ax[1])
plt.show()

这个就奇怪了,直观的感受好像,意大利对获得了冠军,为啥场均进球数这么少。。意大利的比赛是多难看。。

然后其他数据就当做参考吧。

【6】其他

# 传球
plt.figure(figsize=(20,5))
sns.barplot(x = "Player", data = passing_accuracy, y = "Passing accuracy", palette = "Blues")
plt.title("Top players on the basis of passing accuracy")
plt.show()# 头球
plt.figure(figsize=(20,5))
sns.barplot(x = "Player", data = header, y = "Header goals", palette = "Reds", hue = "Goals")
plt.title("Top players on the basis header goals")
plt.show()# 速度
speedy = train_df.sort_values(["Top speed"], ascending=False).iloc[:10]
plt.figure(figsize=(20,5))
sns.barplot(x = "Player", data = speedy, y = "Top speed", palette = "Greens")
plt.title("Top playerson the basis of their speed")
plt.show()# 黄牌数
yelloww = train_df.sort_values(["Yellow cards"], ascending=False).iloc[:10]
plt.figure(figsize=(20,5))
sns.barplot(x = "Player", data = yelloww, y = "Yellow cards", palette = "Greens")
plt.title("Yellow card receivers")
plt.show()# 抢断
blockers = train_df.sort_values(["Shot blocks"], ascending=False).iloc[:10]
plt.figure(figsize=(20,5))
sns.barplot(x = "Player", data = blockers, y = "Shot blocks", palette = "Blues")
plt.title("Shot Blockers")
plt.show()# 出场场次
blockers = train_df.sort_values(["Match played"], ascending=False).iloc[:10]
plt.figure(figsize=(20,5))
sns.barplot(x = "Player", data = blockers, y = "Match played", palette = "Oranges")
plt.title("Matches Played")
plt.show()# 助攻
Assisters = train_df.sort_values(["Assists"], ascending=False).iloc[:10]
plt.figure(figsize=(20,5))
sns.barplot(x = "Player", data = Assisters, y = "Assists", palette = "Greens")
plt.title("Matches Played")
plt.show()# 传球不好的
Worst_passers = train_df.sort_values(["Passing accuracy"], ascending=True).iloc[:10]
plt.figure(figsize=(20,5))
sns.barplot(x = "Player", data = Worst_passers, y = "Passing accuracy", palette = "Greens")
plt.title("Not good Passers")
plt.show()# 被犯规数
Foulers = train_df.sort_values(["Fouls suffered"], ascending=False).iloc[:10]
plt.figure(figsize=(20,5))
sns.barplot(x = "Player", data = Foulers, y = "Fouls suffered", palette = "Greens")
plt.title("Foul sufferers")
plt.show()# 犯规数
Foulers = train_df.sort_values(["Fouls committed"], ascending=False).iloc[:10]
plt.figure(figsize=(20,5))
sns.barplot(x = "Player", data = Foulers, y = "Fouls committed", palette = "Greens")
plt.title("Foul makers")
plt.show()

【7】总结

最后去看了下,最后欧洲杯的最佳球员是谁,有点意料之外的,尽然是意大利的守门员。。如果是这样。守门员的数据需要单独拿出来比较。这样也说明了,意大利对真的是看守门员的。。哈哈

分析谁是2020欧洲杯的最佳球员相关推荐

  1. 互联网日报 | 3月5日 星期五 | 抖音成为2020欧洲杯官方合作伙伴;携程GMV连续三年全球旅企第一;华为发布好望云服务...

    今日看点 ✦ 携程2020年GMV达3950亿元,连续3年稳居全球在线旅游行业第一 ✦ 趣头条2020年营收52.85亿元,首次实现季度盈利 ✦ 华为发布好望云服务:机器视觉战略再升级,使能行业数字化 ...

  2. 4家赞助商来自中国,中国企业“霸屏”欧洲杯!看看各大品牌借势营销哪家强?

    2021 年 6 月,因为疫情而延期一年的 2020 欧洲杯终于迎来开赛,本次欧洲杯是新冠疫情以来的第一场大型体育赛事.小编通过西瓜微数观察发现这次比赛多次登上微博热搜,热搜话题从#欧洲版开幕式#到# ...

  3. c++builder 6 转成vs_官方:欧洲杯将在2021年6月11日至7月11日进行,举办城市不变...

    欧足联官方宣布,2020欧洲杯仍将在原定的12座城市举办,比赛时间定在2021年6月11日-7月11日. 希望退票的球迷可以在2020年6月18日至6月25日进行退票. 2020欧洲杯附加赛暂定于今年 ...

  4. 欧洲杯法国1-0德国,乌龙球致胜,下次对战匈牙利有把握胜利吗?

    6月16日凌晨3点,2020欧洲杯F组首轮一场比赛在慕尼黑竞技场展开争夺,欧洲杯的夺冠热门法国队和德国队迎来正面对决.德法大战极其的激烈,双方都加固防线,射门的机会并不多.令人意外的是在比赛进行到第1 ...

  5. 欧洲杯上那让人惊叹的vivo蓝

    vivo又"出圈"! 6月12日,备受广大球迷期待的2020欧洲杯在意大利罗马的奥林匹克体育场拉开帷幕,由欧足联和中国智能手机品牌vivo联合共同呈现的开幕式表演十分精彩,为人们留 ...

  6. 欧洲杯竞猜|周末在家预测欧洲杯淘汰赛

    6月25日讯(记者 岛主 )16强,众神归位! 北京时间6月24日凌晨,欧洲杯小组赛全部结束,新的阶段将从6月27日凌晨开启,接下来的半个月,欧洲杯的剧情将持续高能,步步惊心. 北京时间6月24日,随 ...

  7. 欧洲杯发布首座区块链奖杯:中国设计师创作,灵感来源小篆

    欧洲杯得分王奖杯用于嘉奖赛事进球榜排名前三的球员 6月12日凌晨,因疫情推迟了一年的足球欧洲杯,终于要重燃战火. 6月10日,欧足联官方也发布了欧洲杯得分王(金靴)奖杯,奖杯分为金银铜三座,分别用于嘉 ...

  8. 谁是欧洲杯夺冠热门球队 德国居榜首英格兰垫底

    这几天,激战正酣的欧洲杯成为了办公室里的热门话题.在小组赛结束后,16支晋级球队已经产生.而在被淘汰的球队中,由伊布拉希莫维奇率领的瑞典队未能出线最为让人惋惜.不过总体来看,这届欧洲杯可谓波澜不惊,传 ...

  9. 这届欧洲杯有点凉?但中国广告主绝不认输

    欧洲杯已经热闹地进入了决赛,但起初很多人并不看好今年的赛事热度. 原因也很简单,一方面由于海外疫情的关系,原定于2020年举办的赛事已经延期了一年.而另一方面,则是与往年某一个国家主办不同,今年的欧洲 ...

最新文章

  1. 微软、海思、任天堂等50多家知名公司源代码泄露,人人均可公开访问
  2. 开发日记-20190516 关键词 MVVM-代码浏览结束
  3. TCP/IP 知识点问答(三)
  4. 小师妹学JavaIO之:文件File和路径Path
  5. Android开发之PCM录音实时播放的实现方法 | 边录音边播放 |PCM录音播放无延迟 | 录音无杂音 | 录音无噪音
  6. 从根本上解决 Infopath 2010 重复表的序号问题
  7. 键盘与鼠标器是微型计算机上最常用的,2016年职称计算机考试WindowsXP考前预测试题5...
  8. 微信上了一个新功能,吐槽的人有点多
  9. python调用动态链接库传送protobuf数据。
  10. 《用户故事与敏捷方法》阅读笔记三
  11. 分布式的Key-Value存储系统Cassandra
  12. Ubuntu图标变成问号
  13. 计算机硬件格式,排版格式要求_计算机硬件及应用_IT/计算机_资料
  14. 无需U盘在Windows下安装Linux系统实现双系统(非子系统)
  15. 【python爬虫】第11章——scrapy框架持久化存储
  16. 计算机网络基础知识之应用层篇
  17. 2022全球「高被引科学家」榜单出炉!中国内地1169人入选,继续紧追美国
  18. Python 数据处理工具 Pandas(上)
  19. java调用oracle过程,JAVA调用ORACLE存储过程报错
  20. 【编程题】【Scratch三级】2022.06 五彩糖葫芦

热门文章

  1. Web缓存中毒(web cache poisoning)学习笔记
  2. ar面部识别_【华为P20Pro评测】系统的进化:面部识别、AR该有的都有_华为 P20 Pro_手机评测-中关村在线...
  3. oracle请求http接口
  4. stm32外部中断问题(每次stm32进行系统复位按键控制NRST=0,程序立马进入中断服务函数)
  5. 文件随机重命名的方法
  6. 给自己的网站添加在线客服代码
  7. Zomm20210715
  8. window 文件夹 标题栏 工具栏不见了
  9. 使用 Vue SVG 快速绘制曲线图(带动画)
  10. 【未解决】pyrit:Scapy 2.x is required to use Pyrit‘s analyze/attack functions but seems to be unavailab