自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

用Python分析了1w場吃雞數(shù)據(jù),原來吃雞要這么玩!

開發(fā) 后端 數(shù)據(jù)分析
絕地求生在國內(nèi)火的一塌糊涂的時候,一款名叫Fortnite的游戲在國外刮起了堡壘旋風(fēng),這款同樣為大逃殺玩法的沙盒類游戲,在絕地求生逐漸走低的形勢下,堡壘之夜卻奪得多項提名,眾多明星主播轉(zhuǎn)戰(zhàn)堡壘!

概述

  • 前言
  • 獲取數(shù)據(jù)
  • 觀察數(shù)據(jù)
  • 數(shù)據(jù)處理
  • 吃雞到底和哪個數(shù)據(jù)相關(guān)性***?
  • 分析熱度圖
  • 期望研究的問題
  • 結(jié)論

前言

絕地求生在國內(nèi)火的一塌糊涂的時候,一款名叫Fortnite的游戲在國外刮起了堡壘旋風(fēng),這款同樣為大逃殺玩法的沙盒類游戲,在絕地求生逐漸走低的形勢下,堡壘之夜卻奪得多項提名,眾多明星主播轉(zhuǎn)戰(zhàn)堡壘!

上天入地,蓋樓修路,鋪陷阱設(shè)彈床;想和太陽肩并肩,一發(fā)火箭就上天。

鑒于“二百斤靈魂”小胖舍友經(jīng)常癡迷于吃雞類游戲,為了幫助他提高游戲勝率,我爬取并分析了1w余場吃雞數(shù)據(jù)。下面讓我們來看一下能吃雞得強相關(guān)條件是什么?

獲取數(shù)據(jù)

首先,我們需要加載Python庫:

  1. import pandas as pd 
  2. import numpy as np 
  3. import matplotlib.pyplot as plt 
  4. import seaborn as sns 
  5. %matplotlib inline 

然后載入Fortnite數(shù)據(jù),檢查數(shù)據(jù)的質(zhì)量和整潔度,然后整理和清理數(shù)據(jù)集,以便進行后續(xù)的清理工作。

  1. #錄入Fornite的CSV數(shù)據(jù) 
  2. Fortnite_data = pd.read_csv('aguang.csv'

為了對數(shù)據(jù)集有一個大致的了解,不妨先輸出數(shù)據(jù)的前幾行。

  1. Fortnite_data.head() 

結(jié)果為:

  1. serial_number  knockout_number  assist-number  save_number  precision  hit_the_target  exact_strike  marching_course  material collection  material-using  afford damage  cause_damage  building-damage  grade  Total-score  Total-experience  teams number  match-time  competitor-name 
  2. 0  1  4  1  0  0.33  69  19  4000  1325  670  554  815  3709  3  448.0  762.0  1  2018/5/14 11:37  Alvin 
  3. 1  2  2  1  0  0.31  28  0  2000  733  110  292  268  7733  9  282.0  536.0  2  2018/5/17 17:48  Alvin 
  4. 2  3  3  0  1  0.21  33  12  3000  1806  350  245  543  7727  8  291.0  597.0  4  2018/5/18 18:05  Alvin 
  5. 3  4  2  0  3  0.05  6  0  3000  700  420  746  163  19008  3  NaN  NaN  4  2018/5/18 18:26  Alvin 
  6. 4  5  1  4  1  0.12  32  7  3000  668  370  212  432  13108  4  358.0  734.0  4  2018/5/18 18:53  Alvin 

觀察數(shù)據(jù)

本數(shù)據(jù)集包含了1w余把游戲數(shù)據(jù),其中可能有“二百斤”的小胖網(wǎng)癮記錄(慘不忍睹:joy:)。該數(shù)據(jù)集中的缺失值被標記為NaN。數(shù)據(jù)列名的含義如下:

  1. serial_number:         游戲場次編號   
  2. knockout_number:  本場淘汰人數(shù)   
  3. assist_number:        助攻數(shù)   
  4. save_number:          救起隊友人數(shù)   
  5. precision:                 射擊精度   
  6. hit_the_target:         ***   
  7. exact_strike:             精準打擊   
  8. marching_course:     行進歷程(m) 
  9. material_collection:  材料已收集   
  10. material-using:         使用材料   
  11. afford_damage:        承受傷害   
  12. cause_damage:         玩家傷害   
  13. building-damage:     建筑傷害   
  14. total_score:               總分 
  15. total_experience:      總經(jīng)驗 
  16. teams_number:        參賽情況(1人為Solo,兩人為Double,4人為team,3人參賽自動填充為4人) 
  17. match_time:             游戲時間 
  18. competitor_name:   該條記錄的所有人 

數(shù)據(jù)處理

查看數(shù)據(jù)類型和數(shù)據(jù)有無缺失值:

  1. #查看數(shù)據(jù)類型和數(shù)據(jù)有無缺失 
  2. Fortnite_data.info() 

查看一下有無重復(fù)數(shù)據(jù):

  1. #查看一下有無重復(fù)數(shù)據(jù) 
  2. Fortnite_data[Fortnite_data.duplicated()]

結(jié)果為:

  1. serial_number  knockout_number  assist-number  save_number  precision  hit_the_target  exact_strike  marching_course  material collection  material-using  afford damage  cause_damage  building-damage  grade  Total-score  Total-experience  teams number  match-time  competitor-name 

查看數(shù)據(jù)的描述統(tǒng)計:

  1. #查看數(shù)據(jù)的描述統(tǒng)計 
  2. Fortnite_data.describe() 

結(jié)果為:

  1. serial_number  knockout_number  assist-number  save_number  precision  hit_the_target  exact_strike  marching_course  material collection  material-using  afford damage  cause_damage  building-damage  grade  Total-score  Total-experience  teams number 
  2. coun 42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  42.000000  20.000000  20.000000  42.000000 
  3. mean 21.500000  2.642857  1.261905  0.380952  0.246429  38.452381  6.976190  2576.142857  1092.785714  312.619048  350.047619  567.309524  9336.119048  6.000000  362.700000  676.350000  3.238095 
  4. std  12.267844  2.818246  1.415240  0.660834  0.168520  32.539809  8.529684  781.055339  617.643932  213.781967  160.616336  434.419966  6366.174673  4.928761  151.638802  274.785519  1.122052 
  5. min  1.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  481.000000  200.000000  0.000000  52.000000  0.000000  1755.000000  1.000000  84.000000  168.000000  1.000000 
  6. 25%  11.250000  1.000000  0.000000  0.000000  0.172500  10.250000  2.000000  2000.000000  694.750000  162.500000  273.000000  262.750000  5780.000000  3.000000  277.750000  507.750000  2.000000 
  7. 50%  21.500000  2.000000  1.000000  0.000000  0.240000  32.500000  3.500000  3000.000000  905.500000  260.000000  326.000000  513.000000  7819.000000  4.000000  328.500000  602.500000  4.000000 
  8. 75%  31.750000  3.000000  2.000000  1.000000  0.305000  56.000000  10.250000  3000.000000  1453.750000  367.500000  403.000000  692.500000  10799.500000  7.750000  403.000000  775.250000  4.000000 
  9. max  42.000000  15.000000  5.000000  3.000000  1.000000  126.000000  39.000000  4000.000000  2728.000000  1060.000000  877.000000  1970.000000  32963.000000  18.000000  728.000000  1238.000000  4.000000 

經(jīng)過分析數(shù)據(jù),發(fā)現(xiàn)一場淘汰13人的數(shù)據(jù),可能存在誤差,單獨輸出看一下:

  1. Fortnite_data[Fortnite_data['knockout_number']==13] 

結(jié)果為:

  1. serial_number  knockout_number  assist-number  save_number  precision  hit_the_target  exact_strike  marching_course  material collection  material-using  afford damage  cause_damage  building-damage  grade  Total-score  Total-experience  teams number  match-time  competitor-name 
  2. 12  13  15  1  0  0.24  103  18  3000  1488  660  52  1970  8612  1  728.0  1238.0  1  2018/5/19 21:47  Wal-Mart 

經(jīng)過分析,這條屬于正常數(shù)據(jù),可能是“有趣的靈魂”小胖同學(xué)這場異常生猛,一人殺了13個,一路高歌在吃雞的道路上,且只有3000m的行進舉例說明基本上沒有跑毒的困擾,可以說天時地利了!

為了提高清潔度,將match-time列拆分成年月日列和小時列,下面是數(shù)據(jù)清理:

  1. #復(fù)制一個備用df 
  2. Fortnite_clean = Fortnite_data.copy() 

問題:獲得***名(吃雞)到底跟那個數(shù)據(jù)相關(guān)性***?

在完成數(shù)據(jù)整理和清理之后,我接下來進行探索性數(shù)據(jù)分析。首先確定研究問題,然后可以輸出描述性統(tǒng)計值,查看有沒有值得研究的點(途中可以因為了解到更好的點而調(diào)整問題方向),創(chuàng)建可視化圖表,解決你在前面提出的研究問題。

探究問題:獲得***名(吃雞)到底跟那個數(shù)據(jù)相關(guān)性***?

  1. Fortnite_clean.head() 
  2. #對整理好的數(shù)據(jù)輸出描述性統(tǒng)計 
  3. Fortnite_clean.describe() 
  4. #選出獲得***名的數(shù)據(jù) 
  5. Fortnite_clean[Fortnite_clean['grade']==1] 

結(jié)果為:

  1. serial_number  knockout_number  assist_number  save_number  precision  hit_the_target  exact_strike  marching_course  material_collection  material_using  afford_damage  cause_damage  building_damage  grade  total_score  total_experience  teams_number  data_sources  match_day  match_hour 
  2. 12  0013  15  1  0  0.24  103  18  3000  1488  660  52  1970  8612  1  728  1238  Solo  Wal-Mart  2018-05-19  21:47:00 
  3. 18  0019  1  1  1  0.02  5  2  4000  1351  250  225  214  8096  1  608  1156  Team  Alvin  2018-05-22  21:24:00 
  4. 25  0026  5  3  1  0.26  62  2  4000  2728  330  83  1040  7096  1  0  0  Team  Wal-Mart  2018-05-28  21:58:00 
  5. 26  0027  2  3  0  0.18  6  0  2000  1955  100  451  541  23633  1  594  1188  Team  Alvin  2018-05-28  21:58:00 
  6. 27  0028  2  4  0  0.19  48  3  3000  1755  590  283  605  20733  1  0  0  Team  Kaka  2018-05-28  21:58:00 

奇怪的是,在吃雞的數(shù)據(jù)中,Wal-Mart的數(shù)據(jù)明顯偏優(yōu)良,Alivn和Kaka的數(shù)據(jù)看起來似乎并不怎么樣,在knockout_number,precision和`cause_damage這幾個我們慣常看的吃雞指標中顯示非常不突出,甚至還不如很多排名比較靠后的數(shù)據(jù)。之后篩選出傷害高于606的數(shù)據(jù)

  1. #篩選出造成傷害高于606的數(shù)據(jù) 
  2. Fortnite_clean[Fortnite_clean['cause_damage']>=606] 

我們可以看到高于吃雞的Alvin和Kaka記錄的那次只造成541和605傷害的數(shù)據(jù)多如牛毛,但是成績貌似并不怎么樣,成績才在第六名徘徊!那是什么原因造成Alvin和Kaka吃雞的呢,難道只是搭上了“二百斤”小胖沃爾瑪?shù)目齑?,兩位都是劃水之輩?

并不是這樣的,我們的眼光落在了afford_damage和building_damage上,兩位都有很高的承受傷害和建筑傷害,(堡壘之夜是可以自己搭建筑作為掩體的)那他們是不是去幫主火力手沃爾瑪去吸引火力和打掉地方簡直給沃爾瑪輸出空間的呢,讓我們繼續(xù)研究。

那么,引來了一個分支問題:圍繞主輸出手,一個有著afford_damage和building_damage的隊友對吃雞有功效嗎?

解決代碼如下:

  1. Fortnite_clean[Fortnite_clean['afford_damage']>=451].grade.mean() 
  2. output:3.125 
  3.  
  4. Fortnite_clean[Fortnite_clean['building_damage']>=20000].grade.mean() 
  5. output:1.75 

可推斷,knockout_number,precision和cause_damage這幾個數(shù)據(jù)對于吃雞固然重要,但是要是在4人小組中,圍繞1到2個輸出位,配置1到2為抗住傷害的肉盾和負責(zé)拆板子的機槍手,對吃雞是大有益處的。

  1. dfData = Fortnite_one.corr() 
  2. plt.subplots(figsize=(8, 8)) # 設(shè)置畫面大小 
  3. sns.heatmap(dfData, annot=True, vmax=1, square=True, cmap="Blues"
  4. plt.show() 

經(jīng)過數(shù)據(jù)的可視化,熱度圖如下: 

用Python分析了1w場吃雞數(shù)據(jù),原來吃雞要這么玩!

分析熱度圖

在熱力圖中,與吃雞(grade)相關(guān)性比較高的前三項是:材料收集、淘汰人數(shù)和造成傷害

之前比較看好的***和精準打擊相關(guān)性不太高,難道良好的FPS手感在堡壘之夜中已經(jīng)不太重要了么,這就還需要更多的數(shù)據(jù)來研究。

期望研究的問題

  • 是否天命圈與能否吃雞是不是有相關(guān)性?(marching_course<2000)
  • 比賽中使用更多的板子與能否吃雞是不是有相關(guān)性?(material_using)

注:由于數(shù)據(jù)量太小,以后能收集到更多的數(shù)據(jù),是希望可以對上面以及更多的方向進行研究。

結(jié)論

根據(jù)上面的熱力圖可以得出如下結(jié)果:

  • 與吃雞相關(guān)性比較高的前三項是:材料收集、淘汰人數(shù)和造成傷害,基本復(fù)合預(yù)期;
  • 材料使用的相關(guān)性高是因為被淘汰的玩家爆出的裝備和材料被撿起也視作材料收集;
  • 組隊如果想要取得好成績,圍繞1到2個輸出位,配置1到2為抗住傷害的肉盾和負責(zé)拆板子的機槍手,才是正道;
  • 正如前面所說,這個分析出來的結(jié)果更偏向于單人吃雞,組隊吃雞,隊員之間的工作分配也是非常重要的。

源碼已上傳Github,可以在下面的地址下載:https://github.com/zandaoguang/eattingchicken

責(zé)任編輯:未麗燕 來源: 視覺算法
相關(guān)推薦

2018-07-10 15:28:44

Python爬蟲數(shù)據(jù)分析

2018-08-01 09:50:47

數(shù)據(jù)吃雞采集

2018-07-26 16:32:31

數(shù)據(jù)吃雞游戲

2018-05-14 08:33:06

比賽數(shù)據(jù)攻略

2020-04-21 15:54:07

戴爾

2017-11-10 17:30:28

雙11

2018-08-21 17:00:00

商用辦公

2018-07-06 14:37:51

吃雞

2019-09-24 11:36:51

Python支付寶數(shù)據(jù)

2020-03-03 15:14:59

手機智能手機來電振動

2018-06-08 16:33:34

大數(shù)據(jù)游戲吃雞

2022-12-06 17:30:04

2016-12-02 20:43:28

Android

2019-04-15 14:15:59

2017-12-21 15:37:29

華為云

2017-12-07 14:44:54

顯卡圖形環(huán)境

2018-10-17 09:25:22

2018-03-06 13:50:54

Windows 7Windows游戲

2019-12-06 11:22:00

中國電信

2018-08-23 05:07:36

神經(jīng)架構(gòu)深度學(xué)習(xí)神經(jīng)網(wǎng)絡(luò)
點贊
收藏

51CTO技術(shù)棧公眾號