diff --git a/awpy/analytics/stats.py b/awpy/analytics/stats.py index bef0bb3cf..880594e43 100644 --- a/awpy/analytics/stats.py +++ b/awpy/analytics/stats.py @@ -136,6 +136,7 @@ def initialize_round( "success1v4": 0, "attempts1v5": 0, "success1v5": 0, + "mvp": 0, } player_statistics[player_key]["totalRounds"] += 1 for player_key in active_players: @@ -620,6 +621,20 @@ def _handle_multi_kills( _increment_statistic(player_statistics, player, n_kills) +def _handle_mvps( + game_round: GameRound, + player_statistics: dict[str, PlayerStatistics], + round_statistics: RoundStatistics, +) -> None: + player_key = ( + game_round["mvpName"] + if game_round["mvpSteamID"] == 0 + else str(game_round["mvpSteamID"]) + ) + if player_key in round_statistics["active_players"]: + player_statistics[player_key]["mvp"] += 1 + + def _increment_statistic( player_statistics: dict[str, PlayerStatistics], player: str, n_kills: int ) -> None: @@ -665,6 +680,7 @@ def player_stats( _handle_bomb(game_round, player_statistics, round_statistics) _handle_kast(player_statistics, round_statistics) _handle_multi_kills(player_statistics, round_statistics) + _handle_mvps(game_round, player_statistics, round_statistics) _finalize_statistics(player_statistics) diff --git a/awpy/parser/demoparser.py b/awpy/parser/demoparser.py index 847782160..1c6477791 100644 --- a/awpy/parser/demoparser.py +++ b/awpy/parser/demoparser.py @@ -763,6 +763,9 @@ def _parse_rounds(self) -> pd.DataFrame: "winningTeam", "losingTeam", "roundEndReason", + "mvpName", + "mvpSteamID", + "mvpReason", "ctFreezeTimeEndEqVal", "ctRoundStartEqVal", "ctRoundSpendMoney", diff --git a/awpy/parser/parse_demo.go b/awpy/parser/parse_demo.go index 1ef41401d..1f63fc1f5 100644 --- a/awpy/parser/parse_demo.go +++ b/awpy/parser/parse_demo.go @@ -138,6 +138,9 @@ type GameRound struct { WinningTeam *string `json:"winningTeam"` LosingTeam *string `json:"losingTeam"` Reason string `json:"roundEndReason"` + MVPName *string `json:"mvpName"` + MVPSteamID *int64 `json:"mvpSteamID"` + MVPReason *string `json:"mvpReason"` CTFreezeTimeEndEqVal int64 `json:"ctFreezeTimeEndEqVal"` CTRoundStartEqVal int64 `json:"ctRoundStartEqVal"` CTRoundMoneySpend int64 `json:"ctRoundSpendMoney"` @@ -556,6 +559,19 @@ func convertRoundEndReason(r events.RoundEndReason) string { } } +func convertRoundMVPReason(r events.RoundMVPReason) string { + switch reason := r; reason { + case events.MVPReasonMostEliminations: + return "MVPReasonMostEliminations" + case events.MVPReasonBombDefused: + return "MVPReasonBombDefused" + case events.MVPReasonBombPlanted: + return "MVPReasonBombPlanted" + default: + return unknown + } +} + func convertHitGroup(hg events.HitGroup) string { switch hitGroup := hg; hitGroup { case events.HitGroupGeneric: @@ -1467,6 +1483,18 @@ func registerRoundEndHandler(demoParser *dem.Parser, currentGame *Game, currentR }) } +func registerRoundMVPHandler(demoParser *dem.Parser, currentRound *GameRound) { + (*demoParser).RegisterEventHandler(func(e events.RoundMVPAnnouncement) { + if e.Player != nil { + currentRound.MVPName = &e.Player.Name + playerSteamID := int64(e.Player.SteamID64) + mvpReason := convertRoundMVPReason(e.Reason) + currentRound.MVPSteamID = &playerSteamID + currentRound.MVPReason = &mvpReason + } + }) +} + func getBombSite(site rune) string { switch site { case rune(events.BombsiteA): @@ -2727,6 +2755,9 @@ func main() { registerRoundEndOfficialHandler(&p, ¤tGame, ¤tRound, &roundInEndTime, &RoundRestartDelay) registerRoundEndHandler(&p, ¤tGame, ¤tRound, &roundStarted, &roundInEndTime, &RoundRestartDelay) + // Parse MVP announcements + registerRoundMVPHandler(&p, ¤tRound) + // Parse bomb defuses registerBombDefusedHandler(&p, ¤tGame, ¤tRound) registerBombDefuseStartHandler(&p, ¤tGame, ¤tRound) diff --git a/awpy/parser/parse_demo_test.go b/awpy/parser/parse_demo_test.go index 69c9e0713..9afde23f5 100644 --- a/awpy/parser/parse_demo_test.go +++ b/awpy/parser/parse_demo_test.go @@ -4,8 +4,26 @@ import ( "testing" common "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/common" + events "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/events" ) +func TestConvertRoundMVPReason(t *testing.T) { + t.Parallel() + enumReasons := [3]events.RoundMVPReason{ + events.MVPReasonMostEliminations, events.MVPReasonBombDefused, events.MVPReasonBombPlanted, + } + textReasons := []string{ + "MVPReasonMostEliminations", "MVPReasonBombDefused", "MVPReasonBombPlanted", + } + for index, reason := range enumReasons { + is := convertRoundMVPReason(reason) + want := textReasons[index] + if is != want { + t.Errorf("Round MVP reason value of %v should convert to %v, got %v", reason, want, is) + } + } +} + func TestConvertRank(t *testing.T) { t.Parallel() var rankInt int diff --git a/awpy/types.py b/awpy/types.py index ec2de03c9..31179b636 100644 --- a/awpy/types.py +++ b/awpy/types.py @@ -569,6 +569,9 @@ class GameRound(TypedDict): winningTeam: str | None losingTeam: str | None roundEndReason: str + mvpName: str | None + mvpSteamID: int | None + mvpReason: str | None ctFreezeTimeEndEqVal: int ctRoundStartEqVal: int ctRoundSpendMoney: int @@ -677,6 +680,7 @@ class PlayerStatistics(TypedDict): success1v4: int attempts1v5: int success1v5: int + mvp: int class KAST(TypedDict): diff --git a/examples/00_Parsing_a_CSGO_Demofile.ipynb b/examples/00_Parsing_a_CSGO_Demofile.ipynb index 8d83d6a0b..fcd8b1ee0 100644 --- a/examples/00_Parsing_a_CSGO_Demofile.ipynb +++ b/examples/00_Parsing_a_CSGO_Demofile.ipynb @@ -5,7 +5,7 @@ "metadata": {}, "source": [ "# Parsing a CSGO demofile¶\n", - "##### Last Updated: October 31, 2022\n", + "##### Last Updated: June 20, 2023\n", "\n", "The awpy package allows for the parsing of CSGO demofiles into JSON or tabular format, which makes for easy analysis. To install the package, clone the Github repository, navigate to the root directory and run `python setup.py install`. Make sure you have installed at least [Golang](https://golang.org/) version 1.17. Please see expanded documentation [here](https://github.com/pnxenopoulos/csgo/tree/main/csgo/docs).\n", "\n", @@ -39,7 +39,12 @@ { "cell_type": "code", "execution_count": 1, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:10.929463300Z", + "start_time": "2023-06-20T18:56:55.151737100Z" + } + }, "outputs": [], "source": [ "from awpy.parser import DemoParser\n", @@ -70,7 +75,12 @@ { "cell_type": "code", "execution_count": 2, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:10.933956600Z", + "start_time": "2023-06-20T18:57:10.930401100Z" + } + }, "outputs": [ { "name": "stdout", @@ -83,10 +93,11 @@ "playbackTicks: 466670\n", "playbackFramesCount: 466095\n", "parsedToFrameIdx: 466110\n", - "parserParameters: {'parseRate': 128, 'parseFrames': False, 'parseKillFrames': False, 'tradeTime': 5, 'roundBuyStyle': 'hltv', 'damagesRolledUp': False}\n", + "parserParameters: {'parseRate': 128, 'parseFrames': True, 'parseKillFrames': False, 'tradeTime': 5, 'roundBuyStyle': 'hltv', 'damagesRolledUp': False, 'parseChat': False}\n", "serverVars: {'cashBombDefused': 0, 'cashBombPlanted': 0, 'cashTeamTWinBomb': 0, 'cashWinDefuse': 3500, 'cashWinTimeRunOut': 0, 'cashWinElimination': 0, 'cashPlayerKilledDefault': 0, 'cashTeamLoserBonus': 0, 'cashTeamLoserBonusConsecutive': 0, 'roundTime': 0, 'roundTimeDefuse': 2, 'roundRestartDelay': 5, 'freezeTime': 20, 'buyTime': 20, 'bombTimer': 0, 'maxRounds': 30, 'timeoutsAllowed': 4, 'coachingAllowed': 1}\n", "matchPhases: {'announcementLastRoundHalf': [239899], 'announcementFinalRound': [], 'announcementMatchStarted': [], 'roundStarted': [890, 7167, 9177, 9308, 43817, 60608, 73511, 84662, 100420, 118340, 135431, 153351, 169400, 181861, 192298, 209674, 227594, 239899, 259186, 294862, 318686, 339215, 346620, 363966, 389948, 410601, 429300, 441487], 'roundEnded': [6782, 43177, 59967, 72870, 84021, 99779, 117700, 134791, 152711, 168760, 181220, 191658, 209035, 226954, 239259, 257266, 294222, 318046, 338574, 345980, 363326, 389308, 409961, 428659, 440847, 458546], 'roundFreezetimeEnded': [3449, 7422, 37043, 46377, 63168, 76071, 87222, 102980, 120900, 137991, 155911, 171960, 184421, 194858, 212234, 230154, 242459, 284731, 302843, 321246, 341775, 349180, 371281, 392508, 418300, 431860, 448917, 458546], 'roundEndedOfficial': [43817, 60608, 73511, 84662, 100420, 118340, 135431, 153351, 169400, 181861, 192298, 209674, 227594, 239899, 259186, 294862, 318686, 339215, 346620, 363966, 389948, 410601, 429300, 441487], 'gameHalfEnded': [257266], 'matchStart': [890, 9313], 'matchStartedChanged': [0, 890, 9184, 9313, 458546], 'warmupChanged': [0, 890, 7167, 9177], 'teamSwitch': [259186]}\n", "matchmakingRanks: []\n", + "chatMessages: []\n", "playerConnections: [{'tick': 0, 'action': 'connect', 'steamID': 76561198045818736}, {'tick': 0, 'action': 'connect', 'steamID': 76561198045695357}, {'tick': 0, 'action': 'connect', 'steamID': 76561198037812456}, {'tick': 0, 'action': 'connect', 'steamID': 76561198146207066}, {'tick': 0, 'action': 'connect', 'steamID': 76561198114929868}, {'tick': 0, 'action': 'connect', 'steamID': 76561198044045107}, {'tick': 0, 'action': 'connect', 'steamID': 76561197960710573}, {'tick': 0, 'action': 'connect', 'steamID': 76561198116523276}, {'tick': 0, 'action': 'connect', 'steamID': 76561198013243326}, {'tick': 0, 'action': 'connect', 'steamID': 76561198016432560}, {'tick': 0, 'action': 'connect', 'steamID': 76561198121220486}, {'tick': 0, 'action': 'connect', 'steamID': 76561198034202275}, {'tick': 4114, 'action': 'connect', 'steamID': 76561198013523865}, {'tick': 458762, 'action': 'disconnect', 'steamID': 76561198121220486}, {'tick': 458894, 'action': 'disconnect', 'steamID': 76561198034202275}, {'tick': 459088, 'action': 'disconnect', 'steamID': 76561198037812456}, {'tick': 459128, 'action': 'disconnect', 'steamID': 76561198114929868}, {'tick': 459271, 'action': 'disconnect', 'steamID': 76561197960710573}, {'tick': 459300, 'action': 'disconnect', 'steamID': 76561198013243326}, {'tick': 459982, 'action': 'disconnect', 'steamID': 76561198016432560}, {'tick': 460307, 'action': 'disconnect', 'steamID': 76561198146207066}, {'tick': 461423, 'action': 'disconnect', 'steamID': 76561198044045107}, {'tick': 463855, 'action': 'disconnect', 'steamID': 76561198045818736}, {'tick': 463855, 'action': 'disconnect', 'steamID': 76561198045695357}, {'tick': 463855, 'action': 'disconnect', 'steamID': 76561198116523276}, {'tick': 463855, 'action': 'disconnect', 'steamID': 76561198013523865}]\n" ] } @@ -108,7 +119,12 @@ { "cell_type": "code", "execution_count": 3, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:10.938848600Z", + "start_time": "2023-06-20T18:57:10.934914400Z" + } + }, "outputs": [ { "name": "stdout", @@ -172,7 +188,12 @@ { "cell_type": "code", "execution_count": 4, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:10.945082300Z", + "start_time": "2023-06-20T18:57:10.941842400Z" + } + }, "outputs": [ { "name": "stdout", @@ -221,7 +242,12 @@ { "cell_type": "code", "execution_count": 5, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:10.951611100Z", + "start_time": "2023-06-20T18:57:10.948085100Z" + } + }, "outputs": [ { "name": "stdout", @@ -244,7 +270,7 @@ "grenadeX: -370.4375\n", "grenadeY: 2254.0625\n", "grenadeZ: -119\n", - "entityId: 663172221523735513\n" + "entityId: 3000740076100106509\n" ] } ], @@ -256,7 +282,12 @@ { "cell_type": "code", "execution_count": 6, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:10.957333700Z", + "start_time": "2023-06-20T18:57:10.954812400Z" + } + }, "outputs": [ { "name": "stdout", @@ -284,7 +315,12 @@ { "cell_type": "code", "execution_count": 7, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:11.044908600Z", + "start_time": "2023-06-20T18:57:10.960475100Z" + } + }, "outputs": [ { "name": "stdout", @@ -319,7 +355,12 @@ { "cell_type": "code", "execution_count": 8, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:11.083168900Z", + "start_time": "2023-06-20T18:57:10.964990300Z" + } + }, "outputs": [ { "name": "stdout", @@ -355,6 +396,54 @@ " print(k + \": \" + str(data[\"gameRounds\"][7][\"flashes\"][0][k]))" ] }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:11.084169700Z", + "start_time": "2023-06-20T18:57:10.967887900Z" + }, + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0: mantuu (MVPReasonMostEliminations)\n", + "1: Boombl4 (MVPReasonMostEliminations)\n", + "2: Boombl4 (MVPReasonMostEliminations)\n", + "3: s1mple (MVPReasonMostEliminations)\n", + "4: mantuu (MVPReasonMostEliminations)\n", + "5: Aleksib (MVPReasonMostEliminations)\n", + "6: s1mple (MVPReasonMostEliminations)\n", + "7: NBK- (MVPReasonMostEliminations)\n", + "8: NBK- (MVPReasonMostEliminations)\n", + "9: mantuu (MVPReasonMostEliminations)\n", + "10: mantuu (MVPReasonMostEliminations)\n", + "11: ISSAA (MVPReasonMostEliminations)\n", + "12: Aleksib (MVPReasonMostEliminations)\n", + "13: s1mple (MVPReasonMostEliminations)\n", + "14: Boombl4 (MVPReasonMostEliminations)\n", + "15: electronic (MVPReasonMostEliminations)\n", + "16: mantuu (MVPReasonMostEliminations)\n", + "17: NBK- (MVPReasonMostEliminations)\n", + "18: NBK- (MVPReasonMostEliminations)\n", + "19: Aleksib (MVPReasonMostEliminations)\n", + "20: mantuu (MVPReasonMostEliminations)\n", + "21: Boombl4 (MVPReasonMostEliminations)\n", + "22: Boombl4 (MVPReasonMostEliminations)\n", + "23: ISSAA (MVPReasonMostEliminations)\n", + "24: valde (MVPReasonMostEliminations)\n" + ] + } + ], + "source": [ + "for i in range(len(data[\"gameRounds\"])):\n", + " print(str(i) + \": \" + data[\"gameRounds\"][i][\"mvpName\"] + \" (\" + data[\"gameRounds\"][7][\"mvpReason\"] + \")\")" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -366,8 +455,13 @@ }, { "cell_type": "code", - "execution_count": 9, - "metadata": {}, + "execution_count": 10, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:26.603916400Z", + "start_time": "2023-06-20T18:57:10.973263100Z" + } + }, "outputs": [ { "data": { @@ -375,7 +469,7 @@ "dict_keys(['matchID', 'clientName', 'mapName', 'tickRate', 'playbackTicks', 'rounds', 'kills', 'damages', 'grenades', 'flashes', 'weaponFires', 'bombEvents', 'frames', 'playerFrames'])" ] }, - "execution_count": 9, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -387,8 +481,13 @@ }, { "cell_type": "code", - "execution_count": 10, - "metadata": {}, + "execution_count": 11, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:26.671372600Z", + "start_time": "2023-06-20T18:57:26.602215900Z" + } + }, "outputs": [ { "data": { @@ -449,10 +548,10 @@ " 1.016636\n", " ...\n", " False\n", - " None\n", - " None\n", - " NaN\n", - " None\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", " USP-S\n", " Pistols\n", " 1\n", @@ -464,7 +563,7 @@ " 39549\n", " 19.578125\n", " 01:36\n", - " 76561198037812448\n", + " 76561198037812456\n", " ISSAA\n", " OGEsports\n", " CT\n", @@ -473,10 +572,10 @@ " 32.390869\n", " ...\n", " False\n", - " None\n", - " None\n", - " NaN\n", - " None\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", " USP-S\n", " Pistols\n", " 1\n", @@ -497,10 +596,10 @@ " 2.132068\n", " ...\n", " False\n", - " None\n", - " None\n", - " NaN\n", - " None\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", " USP-S\n", " Pistols\n", " 1\n", @@ -512,19 +611,19 @@ " 39696\n", " 20.726562\n", " 01:35\n", - " 76561198116523280\n", + " 76561198116523276\n", " flamie\n", " Natus Vincere\n", " T\n", " -604.332642\n", - " 1334.031250\n", + " 1334.03125\n", " -108.254135\n", " ...\n", " False\n", - " None\n", - " None\n", - " NaN\n", - " None\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", " Glock-18\n", " Pistols\n", " 1\n", @@ -540,14 +639,14 @@ " mantuu\n", " OGEsports\n", " CT\n", - " -149.031250\n", + " -149.03125\n", " 1001.231262\n", " 1.489925\n", " ...\n", " True\n", " Aleksib\n", " OGEsports\n", - " 7.656120e+16\n", + " 76561198013243326\n", " CT\n", " USP-S\n", " Pistols\n", @@ -584,7 +683,7 @@ " 456139\n", " 4.148438\n", " 00:36\n", - " 76561198044045104\n", + " 76561198044045107\n", " electronic\n", " Natus Vincere\n", " CT\n", @@ -593,10 +692,10 @@ " -123.553299\n", " ...\n", " False\n", - " None\n", - " None\n", - " NaN\n", - " None\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", " M4A4\n", " Rifle\n", " 25\n", @@ -608,7 +707,7 @@ " 458062\n", " 19.171875\n", " 00:21\n", - " 76561198114929872\n", + " 76561198114929868\n", " valde\n", " OGEsports\n", " T\n", @@ -617,10 +716,10 @@ " 33.910797\n", " ...\n", " False\n", - " None\n", - " None\n", - " NaN\n", - " None\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", " AK-47\n", " Rifle\n", " 25\n", @@ -632,7 +731,7 @@ " 458223\n", " 20.429688\n", " 00:20\n", - " 76561198114929872\n", + " 76561198114929868\n", " valde\n", " OGEsports\n", " T\n", @@ -641,10 +740,10 @@ " 33.111588\n", " ...\n", " False\n", - " None\n", - " None\n", - " NaN\n", - " None\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", + " <NA>\n", " AK-47\n", " Rifle\n", " 25\n", @@ -656,18 +755,18 @@ " 458294\n", " 20.984375\n", " 00:20\n", - " 76561198044045104\n", + " 76561198044045107\n", " electronic\n", " Natus Vincere\n", " CT\n", - " -1753.573730\n", + " -1753.57373\n", " 1118.690674\n", " 31.989418\n", " ...\n", " True\n", " Boombl4\n", " Natus Vincere\n", - " 7.656120e+16\n", + " 76561198146207066\n", " CT\n", " M4A4\n", " Rifle\n", @@ -680,18 +779,18 @@ " 458546\n", " 22.953125\n", " 00:18\n", - " 76561197960710576\n", + " 76561197960710573\n", " NBK-\n", " OGEsports\n", " T\n", - " -1845.399170\n", + " -1845.39917\n", " 2564.569336\n", " 33.790802\n", " ...\n", " True\n", " valde\n", " OGEsports\n", - " 7.656120e+16\n", + " 76561198114929868\n", " T\n", " AK-47\n", " Rifle\n", @@ -707,53 +806,53 @@ "text/plain": [ " tick seconds clockTime attackerSteamID attackerName \\\n", "0 39106 16.117188 01:39 76561198016432560 mantuu \n", - "1 39549 19.578125 01:36 76561198037812448 ISSAA \n", + "1 39549 19.578125 01:36 76561198037812456 ISSAA \n", "2 39632 20.226562 01:35 76561198016432560 mantuu \n", - "3 39696 20.726562 01:35 76561198116523280 flamie \n", + "3 39696 20.726562 01:35 76561198116523276 flamie \n", "4 40045 23.453125 01:32 76561198016432560 mantuu \n", ".. ... ... ... ... ... \n", - "158 456139 4.148438 00:36 76561198044045104 electronic \n", - "159 458062 19.171875 00:21 76561198114929872 valde \n", - "160 458223 20.429688 00:20 76561198114929872 valde \n", - "161 458294 20.984375 00:20 76561198044045104 electronic \n", - "162 458546 22.953125 00:18 76561197960710576 NBK- \n", + "158 456139 4.148438 00:36 76561198044045107 electronic \n", + "159 458062 19.171875 00:21 76561198114929868 valde \n", + "160 458223 20.429688 00:20 76561198114929868 valde \n", + "161 458294 20.984375 00:20 76561198044045107 electronic \n", + "162 458546 22.953125 00:18 76561197960710573 NBK- \n", "\n", " attackerTeam attackerSide attackerX attackerY attackerZ ... \\\n", "0 OGEsports CT -294.155731 626.777832 1.016636 ... \n", "1 OGEsports CT -1845.398804 2719.539307 32.390869 ... \n", "2 OGEsports CT -171.508743 761.183167 2.132068 ... \n", - "3 Natus Vincere T -604.332642 1334.031250 -108.254135 ... \n", - "4 OGEsports CT -149.031250 1001.231262 1.489925 ... \n", + "3 Natus Vincere T -604.332642 1334.03125 -108.254135 ... \n", + "4 OGEsports CT -149.03125 1001.231262 1.489925 ... \n", ".. ... ... ... ... ... ... \n", "158 Natus Vincere CT -484.418335 1847.642334 -123.553299 ... \n", "159 OGEsports T -2025.999146 1511.807251 33.910797 ... \n", "160 OGEsports T -2015.828979 1507.713623 33.111588 ... \n", - "161 Natus Vincere CT -1753.573730 1118.690674 31.989418 ... \n", - "162 OGEsports T -1845.399170 2564.569336 33.790802 ... \n", + "161 Natus Vincere CT -1753.57373 1118.690674 31.989418 ... \n", + "162 OGEsports T -1845.39917 2564.569336 33.790802 ... \n", "\n", " isTrade playerTradedName playerTradedTeam playerTradedSteamID \\\n", - "0 False None None NaN \n", - "1 False None None NaN \n", - "2 False None None NaN \n", - "3 False None None NaN \n", - "4 True Aleksib OGEsports 7.656120e+16 \n", + "0 False \n", + "1 False \n", + "2 False \n", + "3 False \n", + "4 True Aleksib OGEsports 76561198013243326 \n", ".. ... ... ... ... \n", - "158 False None None NaN \n", - "159 False None None NaN \n", - "160 False None None NaN \n", - "161 True Boombl4 Natus Vincere 7.656120e+16 \n", - "162 True valde OGEsports 7.656120e+16 \n", + "158 False \n", + "159 False \n", + "160 False \n", + "161 True Boombl4 Natus Vincere 76561198146207066 \n", + "162 True valde OGEsports 76561198114929868 \n", "\n", " playerTradedSide weapon weaponClass roundNum matchID \\\n", - "0 None USP-S Pistols 1 OG-NaVi-BLAST2020 \n", - "1 None USP-S Pistols 1 OG-NaVi-BLAST2020 \n", - "2 None USP-S Pistols 1 OG-NaVi-BLAST2020 \n", - "3 None Glock-18 Pistols 1 OG-NaVi-BLAST2020 \n", + "0 USP-S Pistols 1 OG-NaVi-BLAST2020 \n", + "1 USP-S Pistols 1 OG-NaVi-BLAST2020 \n", + "2 USP-S Pistols 1 OG-NaVi-BLAST2020 \n", + "3 Glock-18 Pistols 1 OG-NaVi-BLAST2020 \n", "4 CT USP-S Pistols 1 OG-NaVi-BLAST2020 \n", ".. ... ... ... ... ... \n", - "158 None M4A4 Rifle 25 OG-NaVi-BLAST2020 \n", - "159 None AK-47 Rifle 25 OG-NaVi-BLAST2020 \n", - "160 None AK-47 Rifle 25 OG-NaVi-BLAST2020 \n", + "158 M4A4 Rifle 25 OG-NaVi-BLAST2020 \n", + "159 AK-47 Rifle 25 OG-NaVi-BLAST2020 \n", + "160 AK-47 Rifle 25 OG-NaVi-BLAST2020 \n", "161 CT M4A4 Rifle 25 OG-NaVi-BLAST2020 \n", "162 T AK-47 Rifle 25 OG-NaVi-BLAST2020 \n", "\n", @@ -773,7 +872,7 @@ "[163 rows x 50 columns]" ] }, - "execution_count": 10, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -784,8 +883,13 @@ }, { "cell_type": "code", - "execution_count": 11, - "metadata": {}, + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:26.672390Z", + "start_time": "2023-06-20T18:57:26.631438600Z" + } + }, "outputs": [ { "data": { @@ -835,7 +939,7 @@ " \n", " 0\n", " 39015\n", - " 15.406250\n", + " 15.40625\n", " 01:40\n", " 76561198016432560\n", " mantuu\n", @@ -851,7 +955,7 @@ " Neck\n", " False\n", " 465.277175\n", - " 0.0\n", + " 0\n", " 1\n", " OG-NaVi-BLAST2020\n", " de_dust2\n", @@ -875,7 +979,7 @@ " RightArm\n", " False\n", " 486.924484\n", - " 0.0\n", + " 0\n", " 1\n", " OG-NaVi-BLAST2020\n", " de_dust2\n", @@ -899,7 +1003,7 @@ " Head\n", " False\n", " 481.229305\n", - " 0.0\n", + " 0\n", " 1\n", " OG-NaVi-BLAST2020\n", " de_dust2\n", @@ -909,7 +1013,7 @@ " 39526\n", " 19.398438\n", " 01:36\n", - " 76561198044045104\n", + " 76561198044045107\n", " electronic\n", " Natus Vincere\n", " T\n", @@ -923,7 +1027,7 @@ " Head\n", " False\n", " 844.723217\n", - " 0.0\n", + " 0\n", " 1\n", " OG-NaVi-BLAST2020\n", " de_dust2\n", @@ -933,7 +1037,7 @@ " 39549\n", " 19.578125\n", " 01:36\n", - " 76561198037812448\n", + " 76561198037812456\n", " ISSAA\n", " OGEsports\n", " CT\n", @@ -947,7 +1051,7 @@ " Head\n", " False\n", " 1451.886671\n", - " 0.0\n", + " 0\n", " 1\n", " OG-NaVi-BLAST2020\n", " de_dust2\n", @@ -981,13 +1085,13 @@ " 458191\n", " 20.179688\n", " 00:20\n", - " 76561198146207072\n", + " 76561198146207066\n", " Boombl4\n", " Natus Vincere\n", " CT\n", " -1873.927979\n", " 1302.483154\n", - " 33.934990\n", + " 33.93499\n", " ...\n", " 27\n", " 4\n", @@ -995,7 +1099,7 @@ " Chest\n", " False\n", " 259.550535\n", - " 0.0\n", + " 0\n", " 25\n", " OG-NaVi-BLAST2020\n", " de_dust2\n", @@ -1005,7 +1109,7 @@ " 458217\n", " 20.382812\n", " 00:20\n", - " 76561198146207072\n", + " 76561198146207066\n", " Boombl4\n", " Natus Vincere\n", " CT\n", @@ -1019,7 +1123,7 @@ " Chest\n", " False\n", " 252.194264\n", - " 0.0\n", + " 0\n", " 25\n", " OG-NaVi-BLAST2020\n", " de_dust2\n", @@ -1029,7 +1133,7 @@ " 458223\n", " 20.429688\n", " 00:20\n", - " 76561198114929872\n", + " 76561198114929868\n", " valde\n", " OGEsports\n", " T\n", @@ -1043,7 +1147,7 @@ " Head\n", " False\n", " 251.518662\n", - " 0.0\n", + " 0\n", " 25\n", " OG-NaVi-BLAST2020\n", " de_dust2\n", @@ -1053,11 +1157,11 @@ " 458294\n", " 20.984375\n", " 00:20\n", - " 76561198044045104\n", + " 76561198044045107\n", " electronic\n", " Natus Vincere\n", " CT\n", - " -1753.573730\n", + " -1753.57373\n", " 1118.690674\n", " 31.989418\n", " ...\n", @@ -1067,7 +1171,7 @@ " Head\n", " False\n", " 467.218752\n", - " 0.0\n", + " 0\n", " 25\n", " OG-NaVi-BLAST2020\n", " de_dust2\n", @@ -1077,11 +1181,11 @@ " 458546\n", " 22.953125\n", " 00:18\n", - " 76561197960710576\n", + " 76561197960710573\n", " NBK-\n", " OGEsports\n", " T\n", - " -1845.399170\n", + " -1845.39917\n", " 2564.569336\n", " 33.790802\n", " ...\n", @@ -1091,7 +1195,7 @@ " Head\n", " False\n", " 1279.629537\n", - " 0.0\n", + " 0\n", " 25\n", " OG-NaVi-BLAST2020\n", " de_dust2\n", @@ -1103,17 +1207,17 @@ ], "text/plain": [ " tick seconds clockTime attackerSteamID attackerName \\\n", - "0 39015 15.406250 01:40 76561198016432560 mantuu \n", + "0 39015 15.40625 01:40 76561198016432560 mantuu \n", "1 39072 15.851562 01:40 76561198016432560 mantuu \n", "2 39106 16.117188 01:39 76561198016432560 mantuu \n", - "3 39526 19.398438 01:36 76561198044045104 electronic \n", - "4 39549 19.578125 01:36 76561198037812448 ISSAA \n", + "3 39526 19.398438 01:36 76561198044045107 electronic \n", + "4 39549 19.578125 01:36 76561198037812456 ISSAA \n", ".. ... ... ... ... ... \n", - "699 458191 20.179688 00:20 76561198146207072 Boombl4 \n", - "700 458217 20.382812 00:20 76561198146207072 Boombl4 \n", - "701 458223 20.429688 00:20 76561198114929872 valde \n", - "702 458294 20.984375 00:20 76561198044045104 electronic \n", - "703 458546 22.953125 00:18 76561197960710576 NBK- \n", + "699 458191 20.179688 00:20 76561198146207066 Boombl4 \n", + "700 458217 20.382812 00:20 76561198146207066 Boombl4 \n", + "701 458223 20.429688 00:20 76561198114929868 valde \n", + "702 458294 20.984375 00:20 76561198044045107 electronic \n", + "703 458546 22.953125 00:18 76561197960710573 NBK- \n", "\n", " attackerTeam attackerSide attackerX attackerY attackerZ ... \\\n", "0 OGEsports CT -284.767151 632.744629 1.266963 ... \n", @@ -1122,42 +1226,42 @@ "3 Natus Vincere T -579.786072 1494.131836 -110.432953 ... \n", "4 OGEsports CT -1845.398804 2719.539307 32.390869 ... \n", ".. ... ... ... ... ... ... \n", - "699 Natus Vincere CT -1873.927979 1302.483154 33.934990 ... \n", + "699 Natus Vincere CT -1873.927979 1302.483154 33.93499 ... \n", "700 Natus Vincere CT -1883.084595 1294.227783 32.957306 ... \n", "701 OGEsports T -2015.828979 1507.713623 33.111588 ... \n", - "702 Natus Vincere CT -1753.573730 1118.690674 31.989418 ... \n", - "703 OGEsports T -1845.399170 2564.569336 33.790802 ... \n", + "702 Natus Vincere CT -1753.57373 1118.690674 31.989418 ... \n", + "703 OGEsports T -1845.39917 2564.569336 33.790802 ... \n", "\n", - " hpDamageTaken armorDamage armorDamageTaken hitGroup isFriendlyFire \\\n", - "0 32 0 0 Neck False \n", - "1 31 0 0 RightArm False \n", - "2 37 0 0 Head False \n", - "3 91 0 0 Head False \n", - "4 100 0 0 Head False \n", - ".. ... ... ... ... ... \n", - "699 27 4 4 Chest False \n", - "700 27 4 4 Chest False \n", - "701 100 16 16 Head False \n", - "702 46 19 19 Head False \n", - "703 99 15 15 Head False \n", + " hpDamageTaken armorDamage armorDamageTaken hitGroup isFriendlyFire \\\n", + "0 32 0 0 Neck False \n", + "1 31 0 0 RightArm False \n", + "2 37 0 0 Head False \n", + "3 91 0 0 Head False \n", + "4 100 0 0 Head False \n", + ".. ... ... ... ... ... \n", + "699 27 4 4 Chest False \n", + "700 27 4 4 Chest False \n", + "701 100 16 16 Head False \n", + "702 46 19 19 Head False \n", + "703 99 15 15 Head False \n", "\n", " distance zoomLevel roundNum matchID mapName \n", - "0 465.277175 0.0 1 OG-NaVi-BLAST2020 de_dust2 \n", - "1 486.924484 0.0 1 OG-NaVi-BLAST2020 de_dust2 \n", - "2 481.229305 0.0 1 OG-NaVi-BLAST2020 de_dust2 \n", - "3 844.723217 0.0 1 OG-NaVi-BLAST2020 de_dust2 \n", - "4 1451.886671 0.0 1 OG-NaVi-BLAST2020 de_dust2 \n", + "0 465.277175 0 1 OG-NaVi-BLAST2020 de_dust2 \n", + "1 486.924484 0 1 OG-NaVi-BLAST2020 de_dust2 \n", + "2 481.229305 0 1 OG-NaVi-BLAST2020 de_dust2 \n", + "3 844.723217 0 1 OG-NaVi-BLAST2020 de_dust2 \n", + "4 1451.886671 0 1 OG-NaVi-BLAST2020 de_dust2 \n", ".. ... ... ... ... ... \n", - "699 259.550535 0.0 25 OG-NaVi-BLAST2020 de_dust2 \n", - "700 252.194264 0.0 25 OG-NaVi-BLAST2020 de_dust2 \n", - "701 251.518662 0.0 25 OG-NaVi-BLAST2020 de_dust2 \n", - "702 467.218752 0.0 25 OG-NaVi-BLAST2020 de_dust2 \n", - "703 1279.629537 0.0 25 OG-NaVi-BLAST2020 de_dust2 \n", + "699 259.550535 0 25 OG-NaVi-BLAST2020 de_dust2 \n", + "700 252.194264 0 25 OG-NaVi-BLAST2020 de_dust2 \n", + "701 251.518662 0 25 OG-NaVi-BLAST2020 de_dust2 \n", + "702 467.218752 0 25 OG-NaVi-BLAST2020 de_dust2 \n", + "703 1279.629537 0 25 OG-NaVi-BLAST2020 de_dust2 \n", "\n", "[704 rows x 35 columns]" ] }, - "execution_count": 11, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -1165,6 +1269,815 @@ "source": [ "df[\"damages\"]" ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T18:57:26.672390Z", + "start_time": "2023-06-20T18:57:26.668856700Z" + }, + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
roundNummatchIDmapNamestartTickfreezeTimeEndTickendTickendOfficialTicktScorectScoreendTScore...MVPSteamIDMVPReasonctFreezeTimeEndEqValctRoundStartEqValctRoundSpendMoneyctBuyTypetFreezeTimeEndEqValtRoundStartEqValtRoundSpendMoneytBuyType
01OG-NaVi-BLAST2020de_dust29308370434317743817000...76561198016432560MVPReasonMostEliminations440010003400Full Eco425010003450Full Eco
12OG-NaVi-BLAST2020de_dust243817463775996760608011...76561198146207066MVPReasonMostEliminations21200325017950Full Buy10200100010400Semi Buy
23OG-NaVi-BLAST2020de_dust260608631687287073511112...76561198146207066MVPReasonMostEliminations805010008050Semi Eco236001260011000Full Buy
34OG-NaVi-BLAST2020de_dust273511760718402184662213...76561198034202275MVPReasonMostEliminations10001000300Full Eco22450166005850Full Buy
45OG-NaVi-BLAST2020de_dust2846628722299779100420313...76561198016432560MVPReasonMostEliminations22600100021600Full Buy26850176009250Full Buy
56OG-NaVi-BLAST2020de_dust2100420102980117700118340323...76561198013243326MVPReasonMostEliminations21950560016550Full Buy25650100025750Full Buy
67OG-NaVi-BLAST2020de_dust2118340120900134791135431334...76561198034202275MVPReasonBombDefused290501845010800Full Buy23750675018100Full Buy
78OG-NaVi-BLAST2020de_dust2135431137991152711153351434...76561197960710573MVPReasonMostEliminations21750600015950Full Buy233001075015000Full Buy
89OG-NaVi-BLAST2020de_dust2153351155911168760169400444...76561197960710573MVPReasonMostEliminations27450192508800Full Buy22250149505200Full Buy
910OG-NaVi-BLAST2020de_dust2169400171960181220181861454...76561198016432560MVPReasonMostEliminations29100600023100Full Buy15001000700Full Eco
1011OG-NaVi-BLAST2020de_dust2181861184421191658192298464...76561198016432560MVPReasonMostEliminations31900270005100Full Buy17650100023000Semi Buy
1112OG-NaVi-BLAST2020de_dust2192298194858209035209674474...76561198037812456MVPReasonMostEliminations324502205010200Full Buy230010004400Full Eco
1213OG-NaVi-BLAST2020de_dust2209674212234226954227594484...76561198013243326MVPReasonMostEliminations235501675017150Full Buy26450100025450Full Buy
1314OG-NaVi-BLAST2020de_dust2227594230154239259239899495...76561198034202275MVPReasonBombDefused337001410023300Full Buy22150675016000Full Buy
1415OG-NaVi-BLAST2020de_dust2239899242459257266259186596...76561198146207066MVPReasonMostEliminations329501325020300Full Buy198001435013950Semi Buy
1516OG-NaVi-BLAST2020de_dust2259186284731294222294862969...76561198044045107MVPReasonBombPlanted440010003400Full Eco440010003400Full Eco
1617OG-NaVi-BLAST2020de_dust22948623028433180463186869710...76561198016432560MVPReasonMostEliminations19350205019050Semi Buy16200100015200Semi Buy
1718OG-NaVi-BLAST2020de_dust231868632124633857433921510711...76561197960710573MVPReasonMostEliminations640010008950Semi Eco25550955016600Full Buy
1819OG-NaVi-BLAST2020de_dust233921534177534598034662011712...76561197960710573MVPReasonMostEliminations110010001000Full Eco23800755016250Full Buy
1920OG-NaVi-BLAST2020de_dust234662034918036332636396612713...76561198013243326MVPReasonBombDefused21200100021200Full Buy26650200506600Full Buy
2021OG-NaVi-BLAST2020de_dust236396637128138930838994813714...76561198016432560MVPReasonBombDefused1060081503850Semi Buy27150185508950Full Buy
2122OG-NaVi-BLAST2020de_dust238994839250840996141060114714...76561198146207066MVPReasonBombPlanted29250605025450Full Buy270501415012900Full Buy
2223OG-NaVi-BLAST2020de_dust241060141830042865942930014814...76561198146207066MVPReasonMostEliminations309001610014800Full Buy27150675020600Full Buy
2324OG-NaVi-BLAST2020de_dust242930043186044084744148714915...76561198037812456MVPReasonBombDefused27650590022850Full Buy24300100023300Full Buy
2425OG-NaVi-BLAST2020de_dust244148744891745854645918615916...76561198114929868MVPReasonMostEliminations275501585011700Full Buy27050183508700Full Buy
\n", + "

25 rows × 28 columns

\n", + "
" + ], + "text/plain": [ + " roundNum matchID mapName startTick freezeTimeEndTick \\\n", + "0 1 OG-NaVi-BLAST2020 de_dust2 9308 37043 \n", + "1 2 OG-NaVi-BLAST2020 de_dust2 43817 46377 \n", + "2 3 OG-NaVi-BLAST2020 de_dust2 60608 63168 \n", + "3 4 OG-NaVi-BLAST2020 de_dust2 73511 76071 \n", + "4 5 OG-NaVi-BLAST2020 de_dust2 84662 87222 \n", + "5 6 OG-NaVi-BLAST2020 de_dust2 100420 102980 \n", + "6 7 OG-NaVi-BLAST2020 de_dust2 118340 120900 \n", + "7 8 OG-NaVi-BLAST2020 de_dust2 135431 137991 \n", + "8 9 OG-NaVi-BLAST2020 de_dust2 153351 155911 \n", + "9 10 OG-NaVi-BLAST2020 de_dust2 169400 171960 \n", + "10 11 OG-NaVi-BLAST2020 de_dust2 181861 184421 \n", + "11 12 OG-NaVi-BLAST2020 de_dust2 192298 194858 \n", + "12 13 OG-NaVi-BLAST2020 de_dust2 209674 212234 \n", + "13 14 OG-NaVi-BLAST2020 de_dust2 227594 230154 \n", + "14 15 OG-NaVi-BLAST2020 de_dust2 239899 242459 \n", + "15 16 OG-NaVi-BLAST2020 de_dust2 259186 284731 \n", + "16 17 OG-NaVi-BLAST2020 de_dust2 294862 302843 \n", + "17 18 OG-NaVi-BLAST2020 de_dust2 318686 321246 \n", + "18 19 OG-NaVi-BLAST2020 de_dust2 339215 341775 \n", + "19 20 OG-NaVi-BLAST2020 de_dust2 346620 349180 \n", + "20 21 OG-NaVi-BLAST2020 de_dust2 363966 371281 \n", + "21 22 OG-NaVi-BLAST2020 de_dust2 389948 392508 \n", + "22 23 OG-NaVi-BLAST2020 de_dust2 410601 418300 \n", + "23 24 OG-NaVi-BLAST2020 de_dust2 429300 431860 \n", + "24 25 OG-NaVi-BLAST2020 de_dust2 441487 448917 \n", + "\n", + " endTick endOfficialTick tScore ctScore endTScore ... \\\n", + "0 43177 43817 0 0 0 ... \n", + "1 59967 60608 0 1 1 ... \n", + "2 72870 73511 1 1 2 ... \n", + "3 84021 84662 2 1 3 ... \n", + "4 99779 100420 3 1 3 ... \n", + "5 117700 118340 3 2 3 ... \n", + "6 134791 135431 3 3 4 ... \n", + "7 152711 153351 4 3 4 ... \n", + "8 168760 169400 4 4 4 ... \n", + "9 181220 181861 4 5 4 ... \n", + "10 191658 192298 4 6 4 ... \n", + "11 209035 209674 4 7 4 ... \n", + "12 226954 227594 4 8 4 ... \n", + "13 239259 239899 4 9 5 ... \n", + "14 257266 259186 5 9 6 ... \n", + "15 294222 294862 9 6 9 ... \n", + "16 318046 318686 9 7 10 ... \n", + "17 338574 339215 10 7 11 ... \n", + "18 345980 346620 11 7 12 ... \n", + "19 363326 363966 12 7 13 ... \n", + "20 389308 389948 13 7 14 ... \n", + "21 409961 410601 14 7 14 ... \n", + "22 428659 429300 14 8 14 ... \n", + "23 440847 441487 14 9 15 ... \n", + "24 458546 459186 15 9 16 ... \n", + "\n", + " MVPSteamID MVPReason ctFreezeTimeEndEqVal \\\n", + "0 76561198016432560 MVPReasonMostEliminations 4400 \n", + "1 76561198146207066 MVPReasonMostEliminations 21200 \n", + "2 76561198146207066 MVPReasonMostEliminations 8050 \n", + "3 76561198034202275 MVPReasonMostEliminations 1000 \n", + "4 76561198016432560 MVPReasonMostEliminations 22600 \n", + "5 76561198013243326 MVPReasonMostEliminations 21950 \n", + "6 76561198034202275 MVPReasonBombDefused 29050 \n", + "7 76561197960710573 MVPReasonMostEliminations 21750 \n", + "8 76561197960710573 MVPReasonMostEliminations 27450 \n", + "9 76561198016432560 MVPReasonMostEliminations 29100 \n", + "10 76561198016432560 MVPReasonMostEliminations 31900 \n", + "11 76561198037812456 MVPReasonMostEliminations 32450 \n", + "12 76561198013243326 MVPReasonMostEliminations 23550 \n", + "13 76561198034202275 MVPReasonBombDefused 33700 \n", + "14 76561198146207066 MVPReasonMostEliminations 32950 \n", + "15 76561198044045107 MVPReasonBombPlanted 4400 \n", + "16 76561198016432560 MVPReasonMostEliminations 19350 \n", + "17 76561197960710573 MVPReasonMostEliminations 6400 \n", + "18 76561197960710573 MVPReasonMostEliminations 1100 \n", + "19 76561198013243326 MVPReasonBombDefused 21200 \n", + "20 76561198016432560 MVPReasonBombDefused 10600 \n", + "21 76561198146207066 MVPReasonBombPlanted 29250 \n", + "22 76561198146207066 MVPReasonMostEliminations 30900 \n", + "23 76561198037812456 MVPReasonBombDefused 27650 \n", + "24 76561198114929868 MVPReasonMostEliminations 27550 \n", + "\n", + " ctRoundStartEqVal ctRoundSpendMoney ctBuyType tFreezeTimeEndEqVal \\\n", + "0 1000 3400 Full Eco 4250 \n", + "1 3250 17950 Full Buy 10200 \n", + "2 1000 8050 Semi Eco 23600 \n", + "3 1000 300 Full Eco 22450 \n", + "4 1000 21600 Full Buy 26850 \n", + "5 5600 16550 Full Buy 25650 \n", + "6 18450 10800 Full Buy 23750 \n", + "7 6000 15950 Full Buy 23300 \n", + "8 19250 8800 Full Buy 22250 \n", + "9 6000 23100 Full Buy 1500 \n", + "10 27000 5100 Full Buy 17650 \n", + "11 22050 10200 Full Buy 2300 \n", + "12 16750 17150 Full Buy 26450 \n", + "13 14100 23300 Full Buy 22150 \n", + "14 13250 20300 Full Buy 19800 \n", + "15 1000 3400 Full Eco 4400 \n", + "16 2050 19050 Semi Buy 16200 \n", + "17 1000 8950 Semi Eco 25550 \n", + "18 1000 1000 Full Eco 23800 \n", + "19 1000 21200 Full Buy 26650 \n", + "20 8150 3850 Semi Buy 27150 \n", + "21 6050 25450 Full Buy 27050 \n", + "22 16100 14800 Full Buy 27150 \n", + "23 5900 22850 Full Buy 24300 \n", + "24 15850 11700 Full Buy 27050 \n", + "\n", + " tRoundStartEqVal tRoundSpendMoney tBuyType \n", + "0 1000 3450 Full Eco \n", + "1 1000 10400 Semi Buy \n", + "2 12600 11000 Full Buy \n", + "3 16600 5850 Full Buy \n", + "4 17600 9250 Full Buy \n", + "5 1000 25750 Full Buy \n", + "6 6750 18100 Full Buy \n", + "7 10750 15000 Full Buy \n", + "8 14950 5200 Full Buy \n", + "9 1000 700 Full Eco \n", + "10 1000 23000 Semi Buy \n", + "11 1000 4400 Full Eco \n", + "12 1000 25450 Full Buy \n", + "13 6750 16000 Full Buy \n", + "14 14350 13950 Semi Buy \n", + "15 1000 3400 Full Eco \n", + "16 1000 15200 Semi Buy \n", + "17 9550 16600 Full Buy \n", + "18 7550 16250 Full Buy \n", + "19 20050 6600 Full Buy \n", + "20 18550 8950 Full Buy \n", + "21 14150 12900 Full Buy \n", + "22 6750 20600 Full Buy \n", + "23 1000 23300 Full Buy \n", + "24 18350 8700 Full Buy \n", + "\n", + "[25 rows x 28 columns]" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df[\"rounds\"]" + ] } ], "metadata": { diff --git a/examples/01_Basic_CSGO_Analysis.ipynb b/examples/01_Basic_CSGO_Analysis.ipynb index e41f7855e..902feb91e 100644 --- a/examples/01_Basic_CSGO_Analysis.ipynb +++ b/examples/01_Basic_CSGO_Analysis.ipynb @@ -5,7 +5,7 @@ "metadata": {}, "source": [ "# Basic CSGO Analysis\n", - "##### *Last Updated: October 31, 2022*\n", + "##### *Last Updated: June 20, 2023*\n", "The awpy package was developed with easy analysis in mind. To start, a user must first parse the demofile, which gives information on player actions ([Parsing a CSGO demofile](https://github.com/pnxenopoulos/awpy/blob/master/examples/00_Parsing_a_CSGO_Demofile.ipynb)). However, we often want to calculate statistics for a player or team from a demofile. Thus, we provide the `awpy.analytics.stats` module.\n", "\n", "\n", @@ -15,7 +15,12 @@ { "cell_type": "code", "execution_count": 1, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T19:02:34.127114300Z", + "start_time": "2023-06-20T19:02:25.138427300Z" + } + }, "outputs": [ { "name": "stderr", @@ -51,65 +56,16 @@ { "cell_type": "code", "execution_count": 2, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T19:02:34.147738Z", + "start_time": "2023-06-20T19:02:34.129517600Z" + } + }, "outputs": [ { "data": { - "text/plain": [ - "{'steamID': 76561197999004010,\n", - " 'playerName': 'Stewie2K',\n", - " 'teamName': 'Team Liquid',\n", - " 'isBot': False,\n", - " 'totalRounds': 28,\n", - " 'kills': 17,\n", - " 'deaths': 20,\n", - " 'kdr': 0.85,\n", - " 'assists': 6,\n", - " 'tradeKills': 1,\n", - " 'tradedDeaths': 1,\n", - " 'teamKills': 0,\n", - " 'suicides': 0,\n", - " 'flashAssists': 0,\n", - " 'totalDamageGiven': 2326,\n", - " 'totalDamageTaken': 2118,\n", - " 'totalTeamDamageGiven': 0,\n", - " 'adr': 83.1,\n", - " 'totalShots': 284,\n", - " 'shotsHit': 61,\n", - " 'accuracy': 0.21,\n", - " 'rating': 0.99,\n", - " 'kast': 67.9,\n", - " 'hs': 10,\n", - " 'hsPercent': 0.59,\n", - " 'firstKills': 2,\n", - " 'firstDeaths': 3,\n", - " 'utilityDamage': 121,\n", - " 'smokesThrown': 17,\n", - " 'flashesThrown': 7,\n", - " 'heThrown': 6,\n", - " 'fireThrown': 12,\n", - " 'enemiesFlashed': 6,\n", - " 'teammatesFlashed': 2,\n", - " 'blindTime': 14.89,\n", - " 'plants': 2,\n", - " 'defuses': 0,\n", - " 'kills0': 18,\n", - " 'kills1': 4,\n", - " 'kills2': 5,\n", - " 'kills3': 1,\n", - " 'kills4': 0,\n", - " 'kills5': 0,\n", - " 'attempts1v1': 0,\n", - " 'success1v1': 0,\n", - " 'attempts1v2': 0,\n", - " 'success1v2': 0,\n", - " 'attempts1v3': 0,\n", - " 'success1v3': 0,\n", - " 'attempts1v4': 0,\n", - " 'success1v4': 0,\n", - " 'attempts1v5': 0,\n", - " 'success1v5': 0}" - ] + "text/plain": "{'steamID': 76561197999004010,\n 'playerName': 'Stewie2K',\n 'teamName': 'Team Liquid',\n 'isBot': False,\n 'totalRounds': 28,\n 'kills': 17,\n 'deaths': 20,\n 'kdr': 0.85,\n 'assists': 6,\n 'tradeKills': 1,\n 'tradedDeaths': 1,\n 'teamKills': 0,\n 'suicides': 0,\n 'flashAssists': 0,\n 'totalDamageGiven': 2326,\n 'totalDamageTaken': 2118,\n 'totalTeamDamageGiven': 0,\n 'adr': 83.1,\n 'totalShots': 284,\n 'shotsHit': 61,\n 'accuracy': 0.21,\n 'rating': 0.99,\n 'kast': 67.9,\n 'hs': 10,\n 'hsPercent': 0.59,\n 'firstKills': 2,\n 'firstDeaths': 3,\n 'utilityDamage': 121,\n 'smokesThrown': 17,\n 'flashesThrown': 7,\n 'heThrown': 6,\n 'fireThrown': 12,\n 'enemiesFlashed': 6,\n 'teammatesFlashed': 2,\n 'blindTime': 14.89,\n 'plants': 2,\n 'defuses': 0,\n 'kills0': 18,\n 'kills1': 4,\n 'kills2': 5,\n 'kills3': 1,\n 'kills4': 0,\n 'kills5': 0,\n 'attempts1v1': 0,\n 'success1v1': 0,\n 'attempts1v2': 0,\n 'success1v2': 0,\n 'attempts1v3': 0,\n 'success1v3': 0,\n 'attempts1v4': 0,\n 'success1v4': 0,\n 'attempts1v5': 0,\n 'success1v5': 0,\n 'mvp': 3}" }, "execution_count": 2, "metadata": {}, @@ -126,349 +82,17 @@ { "cell_type": "code", "execution_count": 3, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-06-20T19:02:34.175750200Z", + "start_time": "2023-06-20T19:02:34.147738Z" + } + }, "outputs": [ { "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
steamIDplayerNameteamNameisBottotalRoundskillsdeathskdrassiststradeKills...attempts1v1success1v1attempts1v2success1v2attempts1v3success1v3attempts1v4success1v4attempts1v5success1v5
076561197983956651MagiskAstralisFalse2816190.8453...0000000000
176561197990682262Xyp9xAstralisFalse2822161.3832...2200000050
276561197987713664deviceAstralisFalse2823171.3525...1110101010
376561198010511021gla1veAstralisFalse2817161.0682...0000000000
476561198004854956dupreehAstralisFalse2817161.0614...0010100000
576561198066693739EliGETeam LiquidFalse2818210.8633...1110001000
676561198001151695NAFTeam LiquidFalse2817190.8902...0010002000
776561198016255205TwistzzTeam LiquidFalse2813190.6821...1120200020
876561197995889730nitr0Team LiquidFalse2819171.1214...0010002020
976561197999004010Stewie2KTeam LiquidFalse2817200.8561...0000000000
\n", - "

10 rows × 53 columns

\n", - "
" - ], - "text/plain": [ - " steamID playerName teamName isBot totalRounds kills \\\n", - "0 76561197983956651 Magisk Astralis False 28 16 \n", - "1 76561197990682262 Xyp9x Astralis False 28 22 \n", - "2 76561197987713664 device Astralis False 28 23 \n", - "3 76561198010511021 gla1ve Astralis False 28 17 \n", - "4 76561198004854956 dupreeh Astralis False 28 17 \n", - "5 76561198066693739 EliGE Team Liquid False 28 18 \n", - "6 76561198001151695 NAF Team Liquid False 28 17 \n", - "7 76561198016255205 Twistzz Team Liquid False 28 13 \n", - "8 76561197995889730 nitr0 Team Liquid False 28 19 \n", - "9 76561197999004010 Stewie2K Team Liquid False 28 17 \n", - "\n", - " deaths kdr assists tradeKills ... attempts1v1 success1v1 \\\n", - "0 19 0.84 5 3 ... 0 0 \n", - "1 16 1.38 3 2 ... 2 2 \n", - "2 17 1.35 2 5 ... 1 1 \n", - "3 16 1.06 8 2 ... 0 0 \n", - "4 16 1.06 1 4 ... 0 0 \n", - "5 21 0.86 3 3 ... 1 1 \n", - "6 19 0.89 0 2 ... 0 0 \n", - "7 19 0.68 2 1 ... 1 1 \n", - "8 17 1.12 1 4 ... 0 0 \n", - "9 20 0.85 6 1 ... 0 0 \n", - "\n", - " attempts1v2 success1v2 attempts1v3 success1v3 attempts1v4 success1v4 \\\n", - "0 0 0 0 0 0 0 \n", - "1 0 0 0 0 0 0 \n", - "2 1 0 1 0 1 0 \n", - "3 0 0 0 0 0 0 \n", - "4 1 0 1 0 0 0 \n", - "5 1 0 0 0 1 0 \n", - "6 1 0 0 0 2 0 \n", - "7 2 0 2 0 0 0 \n", - "8 1 0 0 0 2 0 \n", - "9 0 0 0 0 0 0 \n", - "\n", - " attempts1v5 success1v5 \n", - "0 0 0 \n", - "1 5 0 \n", - "2 1 0 \n", - "3 0 0 \n", - "4 0 0 \n", - "5 0 0 \n", - "6 0 0 \n", - "7 2 0 \n", - "8 2 0 \n", - "9 0 0 \n", - "\n", - "[10 rows x 53 columns]" - ] + "text/plain": " steamID playerName teamName isBot totalRounds kills \\\n0 76561197983956651 Magisk Astralis False 28 16 \n1 76561197987713664 device Astralis False 28 23 \n2 76561198004854956 dupreeh Astralis False 28 17 \n3 76561198010511021 gla1ve Astralis False 28 17 \n4 76561197990682262 Xyp9x Astralis False 28 22 \n5 76561197995889730 nitr0 Team Liquid False 28 19 \n6 76561198066693739 EliGE Team Liquid False 28 18 \n7 76561197999004010 Stewie2K Team Liquid False 28 17 \n8 76561198016255205 Twistzz Team Liquid False 28 13 \n9 76561198001151695 NAF Team Liquid False 28 17 \n\n deaths kdr assists tradeKills ... success1v1 attempts1v2 \\\n0 19 0.84 5 3 ... 0 0 \n1 17 1.35 2 5 ... 1 1 \n2 16 1.06 1 4 ... 0 1 \n3 16 1.06 8 2 ... 0 0 \n4 16 1.38 3 2 ... 2 0 \n5 17 1.12 1 4 ... 0 1 \n6 21 0.86 3 3 ... 1 1 \n7 20 0.85 6 1 ... 0 0 \n8 19 0.68 2 1 ... 1 2 \n9 19 0.89 0 2 ... 0 1 \n\n success1v2 attempts1v3 success1v3 attempts1v4 success1v4 attempts1v5 \\\n0 0 0 0 0 0 0 \n1 0 1 0 1 0 1 \n2 0 1 0 0 0 0 \n3 0 0 0 0 0 0 \n4 0 0 0 0 0 5 \n5 0 0 0 2 0 2 \n6 0 0 0 1 0 0 \n7 0 0 0 0 0 0 \n8 0 2 0 0 0 2 \n9 0 0 0 2 0 0 \n\n success1v5 mvp \n0 0 1 \n1 0 4 \n2 0 4 \n3 0 3 \n4 0 4 \n5 0 3 \n6 0 2 \n7 0 3 \n8 0 2 \n9 0 2 \n\n[10 rows x 54 columns]", + "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
steamIDplayerNameteamNameisBottotalRoundskillsdeathskdrassiststradeKills...success1v1attempts1v2success1v2attempts1v3success1v3attempts1v4success1v4attempts1v5success1v5mvp
076561197983956651MagiskAstralisFalse2816190.8453...0000000001
176561197987713664deviceAstralisFalse2823171.3525...1101010104
276561198004854956dupreehAstralisFalse2817161.0614...0101000004
376561198010511021gla1veAstralisFalse2817161.0682...0000000003
476561197990682262Xyp9xAstralisFalse2822161.3832...2000000504
576561197995889730nitr0Team LiquidFalse2819171.1214...0100020203
676561198066693739EliGETeam LiquidFalse2818210.8633...1100010002
776561197999004010Stewie2KTeam LiquidFalse2817200.8561...0000000003
876561198016255205TwistzzTeam LiquidFalse2813190.6821...1202000202
976561198001151695NAFTeam LiquidFalse2817190.8902...0100020002
\n

10 rows × 54 columns

\n
" }, "execution_count": 3, "metadata": {}, diff --git a/tests/test_demo_parse.py b/tests/test_demo_parse.py index 56685bff7..12632c21e 100644 --- a/tests/test_demo_parse.py +++ b/tests/test_demo_parse.py @@ -241,6 +241,66 @@ def test_default_parse(self): # sourcery skip: extract-method assert isinstance(game_round["weaponFires"], list) assert isinstance(game_round["frames"], list) + def test_mvp(self): + """Tests mvp.""" + self.default_data = self.parser.parse() + expected = { + 1: { + "mvpName": "tiziaN", + "mvpSteamID": 76561197997556936, + "mvpReason": "MVPReasonMostEliminations", + }, + 3: { + "mvpName": "syrsoNR", + "mvpSteamID": 76561197980122997, + "mvpReason": "MVPReasonBombPlanted", + }, + 8: { + "mvpName": "Ex6TenZ-BALLISTIX", + "mvpSteamID": 76561197972003061, + "mvpReason": "MVPReasonBombDefused", + }, + 11: { + "mvpName": "keev", + "mvpSteamID": 76561198011536764, + "mvpReason": "MVPReasonMostEliminations", + }, + 22: { + "mvpName": "crisby", + "mvpSteamID": 76561197973392984, + "mvpReason": "MVPReasonBombDefused", + }, + 23: {"mvpName": None, "mvpSteamID": None, "mvpReason": None}, + 24: { + "mvpName": "keev", + "mvpSteamID": 76561198011536764, + "mvpReason": "MVPReasonBombDefused", + }, + 27: { + "mvpName": "ALEX * Intel", + "mvpSteamID": 76561198004871434, + "mvpReason": "MVPReasonMostEliminations", + }, + 29: { + "mvpName": "crisby", + "mvpSteamID": 76561197973392984, + "mvpReason": "MVPReasonMostEliminations", + }, + } + for game_round in self.default_data["gameRounds"]: + if game_round["roundNum"] in expected: + assert ( + game_round["mvpName"] == expected[game_round["roundNum"]]["mvpName"] + ) + assert ( + game_round["mvpSteamID"] + == expected[game_round["roundNum"]]["mvpSteamID"] + ) + assert ( + game_round["mvpReason"] + == expected[game_round["roundNum"]]["mvpReason"] + ) + def test_parse_kill_frames(self): """Tests parse kill frames.""" self.parser_kill_frames = DemoParser( diff --git a/tests/test_stats.py b/tests/test_stats.py index fc25498ac..cdfff7cbb 100644 --- a/tests/test_stats.py +++ b/tests/test_stats.py @@ -61,6 +61,7 @@ def test_player_stats_both_json(self): assert stats["76561197995889730"]["firstDeaths"] == 2 assert stats["76561197995889730"]["teamName"] == "Team Liquid" assert stats["76561197995889730"]["playerName"] == "nitr0" + assert stats["76561197995889730"]["mvp"] == 3 assert stats["76561197990682262"]["playerName"] == "Xyp9x" assert stats["76561197990682262"]["attempts1v5"] == 5 @@ -68,11 +69,13 @@ def test_player_stats_both_json(self): assert stats["76561197990682262"]["attempts1v1"] == 2 assert stats["76561197990682262"]["success1v1"] == 2 assert stats["76561197990682262"]["kills5"] == 0 + assert stats["76561197990682262"]["mvp"] == 4 assert stats["76561197987713664"]["playerName"] == "device" assert stats["76561197987713664"]["kills5"] == 1 assert stats["76561197987713664"]["tradeKills"] == 5 assert stats["76561197987713664"]["tradedDeaths"] == 5 + assert stats["76561197987713664"]["mvp"] == 4 def test_player_stats_both_df(self): """Tests player stats generation for df.""" @@ -95,6 +98,7 @@ def test_player_stats_ct(self): assert stats_ct["76561197995889730"]["firstDeaths"] == 0 assert stats_ct["76561197995889730"]["teamName"] == "Team Liquid" assert stats_ct["76561197995889730"]["playerName"] == "nitr0" + assert stats_ct["76561197995889730"]["mvp"] == 3 def test_player_stats_t(self): """Tests json generation of player stats for t.""" @@ -112,6 +116,7 @@ def test_player_stats_t(self): assert stats_t["76561197995889730"]["firstDeaths"] == 2 assert stats_t["76561197995889730"]["teamName"] == "Team Liquid" assert stats_t["76561197995889730"]["playerName"] == "nitr0" + assert stats_t["76561197995889730"]["mvp"] == 0 def test_player_stats_sum(self): """Tests that ct and t stats sum to total."""