Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final_output = []
- game_data = {}
- for game in matches_response:
- participantId = getParticipantId(player, matches_response[game])
- championName = getChampionName(participantId, game, crd)
- game_data['ChampionName'] = championName
- result = getResult(participantId, game)
- game_data['result'] = result
- side = getSide(participantId, game)
- game_data['side'] = side
- gameDuration = getGameDuration(game)
- game_data['gameDuration'] = gameDuration
- kda = getKDA(participantId, game)
- game_data['kills'] = kda[0]
- game_data['death'] = kda[1]
- game_data['assist'] = kda[2]
- cs = getCS(participantId, game)
- totalCS = str(cs[0]) + ' (' + str(cs[1]) + ')'
- game_data['cs'] = totalCS
- goldEarned = getGoldEarned(participantId, game)
- game_data['goldEarned'] = goldEarned
- damages = getDamageToChamps(participantId, game, side)
- totalDamageToChamps = str(damages[0]) + ' (' + str(damages[1]) + '%)'
- game_data['totalDamageToChamps'] = totalDamageToChamps
- bans = getBans(side, game, crd)
- game_data['banTeam1'] = bans[0][0]
- game_data['banTeam2'] = bans[0][1]
- game_data['banTeam3'] = bans[0][2]
- game_data['banTeam4'] = bans[0][3]
- game_data['banTeam5'] = bans[0][4]
- game_data['banOpponent1'] = bans[1][0]
- game_data['banOpponent2'] = bans[1][1]
- game_data['banOpponent3'] = bans[1][2]
- game_data['banOpponent4'] = bans[1][3]
- game_data['banOpponent5'] = bans[1][4]
- teamComp = getTeamComps(side, game, crd)
- game_data['blueChampTop'] = teamComp[0]['Top']
- game_data['blueChampJgl'] = teamComp[0]['Jgl']
- game_data['blueChampMid'] = teamComp[0]['Mid']
- game_data['blueChampAdc'] = teamComp[0]['Adc']
- game_data['blueChampSupp'] = teamComp[0]['Supp']
- game_data['redChampTop'] = teamComp[1]['Top']
- game_data['redChampJgl'] = teamComp[1]['Jgl']
- game_data['redChampMid'] = teamComp[1]['Mid']
- game_data['redChampAdc'] = teamComp[1]['Adc']
- game_data['redChampSupp'] = teamComp[1]['Supp']
- visionScore = getVisionScore(participantId, game)
- game_data['visionScore'] = visionScore['VisionScore']
- game_data['wardsPlaced'] = visionScore['Wards Placed']
- game_data['wardsKilled'] = visionScore['Wards Killed']
- game_data['pinkWards'] = visionScore['Pink Wards']
- turretKilled = getTurretKills(participantId, game)
- game_data['turretKilled'] = turretKilled
- firstBlood = firstBlood(participantId, game)
- game_data['firstBloodKill'] = firstBlood['firstBloodKill']
- game_data['firstBloodAssist'] = firstBlood['firstBloodAssist']
- firstTurret = firstTurret(participantId, game)
- game_data['firstTurretKill'] = firstBlood['firstTurretKill']
- game_data['firstTurretAssist'] = firstBlood['firstTurretAssist']
- firstInhib = firstInhib(participantId, game)
- game_data['firstInhibKill'] = firstBlood['firstInhibKill']
- game_data['firstInhibAssist'] = firstBlood['firstInhibAssist']
- runes = getRunes(participantId, game, runeRawData)
- game_data['runePrincipal'] = runes['runePrincipal']
- game_data['rune1'] = runes['rune1']
- game_data['rune2'] = runes['rune2']
- game_data['rune3'] = runes['rune3']
- game_data['runeSecondaire1'] = runes['rune4']
- game_data['runeSecondaire2'] = runes['rune5']
- items = getItems(participantId, game, ird)
- game_data['items'] = items
- summoners = getSummonerSpells(participantId, game, srd)
- game_data['summoner1'] = summoners['summoner 1']
- game_data['summoner2'] = summoners['summoner 2']
- match_timeline_response = []
- match_timeline_response = api.get_timeline(game['gameId'])
- request_number += 1
- if request_number % 20 == 0:
- time.sleep(2)
- if request_number % 100 == 0:
- time.sleep(120)
- positions = getPositions(participantId, game)
- game_data['position @ 0'] = positions['position0']
- game_data['position @ 1'] = positions['position1']
- game_data['position @ 2'] = positions['position2']
- game_data['position @ 3'] = positions['position3']
- final_output.append(game_data)
- df = pd.DataFrame(final_output)
- df.head(51)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement