In [1]:
import requests
import json

In [2]:
match_id = 3212338121

In [3]:
host = "https://api.opendota.com/api/matches/" + str(match_id)
data = {'match_id': match_id}

In [4]:
request = requests.get(host, data=data)

In [5]:
request.status_code


Out[5]:
200

In [6]:
match_data = request.content
match_data = json.loads(match_data)

In [7]:
match_data.keys()


Out[7]:
[u'barracks_status_dire',
 u'match_id',
 u'barracks_status_radiant',
 u'cluster',
 u'first_blood_time',
 u'chat',
 u'dire_score',
 u'duration',
 u'radiant_win',
 u'skill',
 u'lobby_type',
 u'tower_status_dire',
 u'teamfights',
 u'objectives',
 u'version',
 u'cosmetics',
 u'leagueid',
 u'engine',
 u'radiant_score',
 u'human_players',
 u'start_time',
 u'match_seq_num',
 u'tower_status_radiant',
 u'negative_votes',
 u'picks_bans',
 u'positive_votes',
 u'radiant_xp_adv',
 u'region',
 u'game_mode',
 u'patch',
 u'radiant_gold_adv',
 u'players']

In [8]:
print match_data['game_mode']


22

Fields of interest in match:

1. patch
2. positive_votes and negative_votes
3. first_blood_time
4. barracks_status_radiant
5. barracks_status_dire
6. radiant_win
7. possibly teamfights in the future

In [81]:
# Here we analyze a player
player1 = match_data['players'][0]
print player1.keys()
for player in match_data['players']:
    print player['abandons']


[u'gold', u'actions', u'damage_inflictor_received', u'lh_t', u'repicked', u'damage_taken', u'kill_streaks', u'cosmetics', u'hero_id', u'kills_log', u'account_id', u'kills', u'kills_per_min', u'start_time', u'isRadiant', u'backpack_1', u'backpack_0', u'leaver_status', u'killed', u'stuns', u'gold_per_min', u'name', u'level', u'damage_inflictor', u'patch', u'item_4', u'item_5', u'item_2', u'item_3', u'item_0', u'item_1', u'sen_left_log', u'obs_placed', u'match_id', u'kda', u'pings', u'gold_reasons', u'total_gold', u'item_uses', u'duration', u'sen', u'lobby_type', u'denies', u'killed_by', u'permanent_buffs', u'last_login', u'gold_t', u'xp_per_min', u'ability_uses', u'performance_others', u'lose', u'abandons', u'rune_pickups', u'assists', u'obs_left_log', u'xp_reasons', u'purchase_log', u'region', u'obs_log', u'times', u'pred_vict', u'obs', u'win', u'radiant_win', u'runes', u'game_mode', u'ability_upgrades_arr', u'party_id', u'hero_healing', u'runes_log', u'life_state', u'xp_t', u'benchmarks', u'buyback_log', u'additional_units', u'gold_spent', u'deaths', u'cluster', u'last_hits', u'total_xp', u'player_slot', u'creeps_stacked', u'multi_kills', u'camps_stacked', u'damage', u'sen_log', u'hero_hits', u'solo_competitive_rank', u'tower_damage', u'hero_damage', u'personaname', u'max_hero_hit', u'lane_pos', u'purchase', u'randomed', u'backpack_2', u'sen_placed', u'dn_t']
0
0
0
0
0
0
0
0
0
0

https://github.com/kronusme/dota2-api/blob/master/data/heroes.json https://github.com/kronusme/dota2-api/blob/master/data/items.json

Of interest from the player fields are:

1. gold
2. last_hints
3. damage_taken
4. isRadiant
5. hero_id
6. actions_per_min
7. kills
8. kills_per_min
9. item_win for end state items
10. kda
11. assists
12. deaths
13. total_gold and total_xp
14. denies
15. item_0, item_1, item_2, ..., item_5
16. lane_role
17. lane_efficiency_pct
18. solo_competitive_rank
19. hero_damage
20. hero_healing

In [10]:
heroInfo = {
        "heroes":[
        {
            "name":"npc_dota_hero_antimage",
                "id":1
        },
        {
            "name":"npc_dota_hero_axe",
            "id":2
        },
        {
            "name":"npc_dota_hero_bane",
            "id":3
        },
        {
            "name":"npc_dota_hero_bloodseeker",
            "id":4
        },
        {
            "name":"npc_dota_hero_crystal_maiden",
            "id":5
        },
        {
            "name":"npc_dota_hero_drow_ranger",
            "id":6
        },
        {
            "name":"npc_dota_hero_earthshaker",
            "id":7
        },
        {
            "name":"npc_dota_hero_juggernaut",
            "id":8
        },
        {
            "name":"npc_dota_hero_mirana",
            "id":9
        },
        {
            "name":"npc_dota_hero_nevermore",
            "id":11
        },
        {
            "name":"npc_dota_hero_morphling",
            "id":10
        },
        {
            "name":"npc_dota_hero_phantom_lancer",
            "id":12
        },
        {
            "name":"npc_dota_hero_puck",
            "id":13
        },
        {
            "name":"npc_dota_hero_pudge",
            "id":14
        },
        {
            "name":"npc_dota_hero_razor",
            "id":15
        },
        {
            "name":"npc_dota_hero_sand_king",
            "id":16
        },
        {
            "name":"npc_dota_hero_storm_spirit",
            "id":17
        },
        {
            "name":"npc_dota_hero_sven",
            "id":18
        },
        {
            "name":"npc_dota_hero_tiny",
            "id":19
        },
        {
            "name":"npc_dota_hero_vengefulspirit",
            "id":20
        },
        {
            "name":"npc_dota_hero_windrunner",
            "id":21
        },
        {
            "name":"npc_dota_hero_zuus",
            "id":22
        },
        {
            "name":"npc_dota_hero_kunkka",
            "id":23
        },
        {
            "name":"npc_dota_hero_lina",
            "id":25
        },
        {
            "name":"npc_dota_hero_lich",
            "id":31
        },
        {
            "name":"npc_dota_hero_lion",
            "id":26
        },
        {
            "name":"npc_dota_hero_shadow_shaman",
            "id":27
        },
        {
            "name":"npc_dota_hero_slardar",
            "id":28
        },
        {
            "name":"npc_dota_hero_tidehunter",
            "id":29
        },
        {
            "name":"npc_dota_hero_witch_doctor",
            "id":30
        },
        {
            "name":"npc_dota_hero_riki",
            "id":32
        },
        {
            "name":"npc_dota_hero_enigma",
            "id":33
        },
        {
            "name":"npc_dota_hero_tinker",
            "id":34
        },
        {
            "name":"npc_dota_hero_sniper",
            "id":35
        },
        {
            "name":"npc_dota_hero_necrolyte",
            "id":36
        },
        {
            "name":"npc_dota_hero_warlock",
            "id":37
        },
        {
            "name":"npc_dota_hero_beastmaster",
            "id":38
        },
        {
            "name":"npc_dota_hero_queenofpain",
            "id":39
        },
        {
            "name":"npc_dota_hero_venomancer",
            "id":40
        },
        {
            "name":"npc_dota_hero_faceless_void",
            "id":41
        },
        {
            "name":"npc_dota_hero_skeleton_king",
            "id":42
        },
        {
            "name":"npc_dota_hero_death_prophet",
            "id":43
        },
        {
            "name":"npc_dota_hero_phantom_assassin",
            "id":44
        },
        {
            "name":"npc_dota_hero_pugna",
            "id":45
        },
        {
            "name":"npc_dota_hero_templar_assassin",
            "id":46
        },
        {
            "name":"npc_dota_hero_viper",
            "id":47
        },
        {
            "name":"npc_dota_hero_luna",
            "id":48
        },
        {
            "name":"npc_dota_hero_dragon_knight",
            "id":49
        },
        {
            "name":"npc_dota_hero_dazzle",
            "id":50
        },
        {
            "name":"npc_dota_hero_rattletrap",
            "id":51
        },
        {
            "name":"npc_dota_hero_leshrac",
            "id":52
        },
        {
            "name":"npc_dota_hero_furion",
            "id":53
        },
        {
            "name":"npc_dota_hero_life_stealer",
            "id":54
        },
        {
            "name":"npc_dota_hero_dark_seer",
            "id":55
        },
        {
            "name":"npc_dota_hero_clinkz",
            "id":56
        },
        {
            "name":"npc_dota_hero_omniknight",
            
            "id":57
        },
        {
            "name":"npc_dota_hero_enchantress",
            "id":58
        },
        {
            "name":"npc_dota_hero_huskar",
            "id":59
        },
        {
            "name":"npc_dota_hero_night_stalker",
            "id":60
        },
        {
            "name":"npc_dota_hero_broodmother",
            "id":61
        },
        {
            "name":"npc_dota_hero_bounty_hunter",
            "id":62
        },
        {
            "name":"npc_dota_hero_weaver",
            "id":63
        },
        {
            "name":"npc_dota_hero_jakiro",
            "id":64
        },
        {
            "name":"npc_dota_hero_batrider",
            "id":65
        },
        {
            "name":"npc_dota_hero_chen",
            "id":66
        },
        {
            "name":"npc_dota_hero_spectre",
            "id":67
        },
        {
            "name":"npc_dota_hero_doom_bringer",
            "id":69
        },
        {
            "name":"npc_dota_hero_ancient_apparition",
            "id":68
        },
        {
            "name":"npc_dota_hero_ursa",
            "id":70
        },
        {
            "name":"npc_dota_hero_spirit_breaker",
            "id":71
        },
        {
            "name":"npc_dota_hero_gyrocopter",
            "id":72
        },
        {
            "name":"npc_dota_hero_alchemist",
            "id":73
        },
        {
            "name":"npc_dota_hero_invoker",
            "id":74
        },
        {
            "name":"npc_dota_hero_silencer",
            "id":75
        },
        {
            "name":"npc_dota_hero_obsidian_destroyer",
            "id":76
        },
        {
            "name":"npc_dota_hero_lycan",
            "id":77
        },
        {
            "name":"npc_dota_hero_brewmaster",
            "id":78
        },
        {
            "name":"npc_dota_hero_shadow_demon",
            "id":79
        },
        {
            "name":"npc_dota_hero_lone_druid",
            "id":80
        },
        {
            "name":"npc_dota_hero_chaos_knight",
            "id":81
        },
        {
            "name":"npc_dota_hero_meepo",
            "id":82
        },
        {
            "name":"npc_dota_hero_treant",
            "id":83
        },
        {
            "name":"npc_dota_hero_ogre_magi",
            "id":84
        },
        {
            "name":"npc_dota_hero_undying",
            "id":85
        },
        {
            "name":"npc_dota_hero_rubick",
            "id":86
        },
        {
            "name":"npc_dota_hero_disruptor",
            "id":87
        },
        {
            "name":"npc_dota_hero_nyx_assassin",
            "id":88
        },
        {
            "name":"npc_dota_hero_naga_siren",
            "id":89
        },
        {
            "name":"npc_dota_hero_keeper_of_the_light",
            "id":90
        },
        {
            "name":"npc_dota_hero_wisp",
            "id":91
        },
        {
            "name":"npc_dota_hero_visage",
            "id":92
        },
        {
            "name":"npc_dota_hero_slark",
            "id":93
        },
        {
            "name":"npc_dota_hero_medusa",
            "id":94
        },
        {
            "name":"npc_dota_hero_troll_warlord",
            "id":95
        },
        {
            "name":"npc_dota_hero_centaur",
            "id":96
        },
        {
            "name":"npc_dota_hero_magnataur",
            "id":97
        },
        {
            "name":"npc_dota_hero_shredder",
            "id":98
        },
        {
            "name":"npc_dota_hero_bristleback",
            "id":99
        },
        {
            "name":"npc_dota_hero_tusk",
            "id":100
        },
        {
            "name":"npc_dota_hero_skywrath_mage",
            "id":101
        },
        {
            "name":"npc_dota_hero_abaddon",
            "id":102
        },
        {
            "name":"npc_dota_hero_elder_titan",
            "id":103
        },
        {
            "name":"npc_dota_hero_legion_commander",
            "id":104
        },
        {
            "name":"npc_dota_hero_ember_spirit",
            "id":106
        },
        {
            "name":"npc_dota_hero_earth_spirit",
            "id":107
        },
        {
            "name":"npc_dota_hero_terrorblade",
            "id":109
        },
        {
            "name":"npc_dota_hero_phoenix",
            "id":110
        },
        {
            "name":"npc_dota_hero_oracle",
            "id":111
        },
        {
            "name":"npc_dota_hero_techies",
            "id":105
        },
        {
            "name":"npc_dota_hero_winter_wyvern",
            "id":112
        },
        {
            "name":"npc_dota_hero_arc_warden",
            "id":113
        },
        {
            "name":"npc_dota_hero_abyssal_underlord",
            "id":108
        },
        {
            "name":"npc_dota_hero_monkey_king",
            "id":114
        }
        ]
}

heroRoles = {
    1: [1], 2: [3, 2, 4], 3: [5, 4],
    4: [3, 2], 5: [5, 4], 6: [1, 2],
    7: [4, 5], 8: [1, 2], 9: [2, 3, 1],
    10: [1, 2], 11: [2, 1], 12: [1],
    13: [2], 14: [2, 4], 15: [2],
    16: [3, 4], 17: [2], 18: [1],
    19: [2, 4], 20: [5, 4, 1], 21: [2],
    22: [2], 23: [2, 3], 25: [2, 4],
    26: [4, 5], 27: [5, 4, 2], 28: [4, 3, 1],
    29: [3, 4], 30: [4, 5], 31: [5],
    32: [4], 33: [4], 34: [2],
    35: [2, 1, 3], 36: [3, 4, 2], 37: [4, 5],
    38: [3, 4], 39: [2], 40: [4, 2],
    41: [3, 1], 42: [3, 1], 43: [2],
    44: [1], 45: [4, 2, 5], 46: [2],
    47: [2], 48: [1], 49: [2, 3, 1],
    50: [5, 4], 51: [3], 52: [2, 4],
    53: [4], 54: [4, 3], 55: [3],
    56: [3], 57: [5], 58: [4],
    59: [2, 1, 3], 60: [4, 2], 61: [3],
    62: [4], 63: [3], 64: [5, 2],
    65: [2, 3], 66: [4], 67: [1],
    68: [5], 69: [4, 3], 70: [4],
    71: [4, 3], 72: [1], 73: [2, 4],
    74: [2], 75: [5], 76: [2],
    77: [4], 78: [2], 79: [5],
    80: [4, 3], 81: [1, 4], 82: [2],
    83: [5], 84: [5], 85: [5, 4],
    86: [5], 87: [5], 88: [3],
    89: [1, 4], 90: [5], 91: [5],
    92: [4], 93: [1], 94: [1], 
    95: [1], 96: [3], 97: [2],
    98: [3, 2], 99: [3], 100: [3],
    101: [5, 4], 102: [5], 103: [3],
    104: [4], 105: [4], 106: [2],
    107: [4], 108: [3], 109: [1],
    110: [4], 111: [5], 112: [5],
    113: [2], 114: [2, 4]   
}
len(heroRoles)


Out[10]:
113

In [11]:
import random
# return the roles of farm priority (1-5) for the corresponding hero ID
# the roles are in descending order of common if there is more than one
def classifyHeroRoles(heroID):
    return heroRoles[heroID]

def giveHeroRole(heroID, availableRoles):
    roles = classifyHeroRoles(heroID)
    if len(roles) == 1 and roles[0] in availableRoles:
        return roles[0]
    elif len(roles) == 1:
        return random.choice(availableRoles)
    for role in roles:
        if role in availableRoles:
            return role
    return random.choice(availableRoles)

def classifyTeam(heroIDsOnFullTeam):
    classifiedTeam = {}
    availableRoles = [1, 2, 3, 4, 5]
    heroIDsOnFullTeam = sorted(heroIDsOnFullTeam, key = lambda x: len(classifyHeroRoles(x)))
    for heroID in heroIDsOnFullTeam:
        givenRole = giveHeroRole(heroID, availableRoles)
        availableRoles.remove(givenRole)
        classifiedTeam[givenRole] = heroID
    return classifiedTeam

In [82]:
def PlayerExtractKey(playerJSON, key):
    if key in playerJSON:
        return playerJSON[key]
    else:
        return float('nan')

def extractDotaInformation(matchJSON):
    matchInfo = {}
    matchInfo['match_id'] = matchJSON['match_id']
    matchInfo['patch'] = matchJSON['patch']
    matchInfo['positive_votes'] = matchJSON['positive_votes']
    matchInfo['negative_votes'] = matchJSON['negative_votes']
    matchInfo['first_blood_time'] = matchJSON['first_blood_time']
    matchInfo['barracks_status_radiant'] = matchJSON['barracks_status_radiant']
    matchInfo['barracks_status_dire'] = matchJSON['barracks_status_dire']
    matchInfo['tower_status_radiant'] = matchJSON['tower_status_radiant']
    matchInfo['tower_status_dire'] = matchJSON['tower_status_dire']
    matchInfo['radiant_win'] = matchJSON['radiant_win']
    matchInfo['duration'] = matchJSON['duration']
    
    heroesRadiant = []
    heroesDire = []
    
    for player in matchJSON['players']:
        if player['isRadiant']:
            heroesRadiant.append(player['hero_id'])
        else:
            heroesDire.append(player['hero_id'])
            
    heroesRadiant = classifyTeam(heroesRadiant)
    heroesDire = classifyTeam(heroesDire)
    matchInfo['radiant_pos1'] = heroesRadiant[1]
    matchInfo['radiant_pos2'] = heroesRadiant[2]
    matchInfo['radiant_pos3'] = heroesRadiant[3]
    matchInfo['radiant_pos4'] = heroesRadiant[4]
    matchInfo['radiant_pos5'] = heroesRadiant[5]
    matchInfo['dire_pos1'] = heroesDire[1]
    matchInfo['dire_pos2'] = heroesDire[2]
    matchInfo['dire_pos3'] = heroesDire[3]
    matchInfo['dire_pos4'] = heroesDire[4]
    matchInfo['dire_pos5'] = heroesDire[5]
    for player in matchJSON['players']:
        factions = ['radiant', 'dire']
        poss = ['_pos1', '_pos2', '_pos3', '_pos4', '_pos5']
        for faction in factions:
            for pos in poss:
                if player['hero_id'] == matchInfo[faction+pos]:
                    factionpos = faction+pos
                    matchInfo[factionpos+'_hero_id'] = PlayerExtractKey(player, "hero_id")
                    matchInfo[factionpos+'_item0'] = PlayerExtractKey(player, 'item_0')
                    matchInfo[factionpos+'_item1'] = PlayerExtractKey(player, 'item_1')
                    matchInfo[factionpos+'_item2'] = PlayerExtractKey(player, 'item_2')
                    matchInfo[factionpos+'_item3'] = PlayerExtractKey(player, 'item_3')
                    matchInfo[factionpos+'_item4'] = PlayerExtractKey(player, 'item_4')
                    matchInfo[factionpos+'_item5'] = PlayerExtractKey(player, 'item_5')
                    matchInfo[factionpos+'_kills'] = PlayerExtractKey(player, 'kills')
                    matchInfo[factionpos+'_deaths'] = PlayerExtractKey(player, 'deaths')
                    matchInfo[factionpos+'_assists'] = PlayerExtractKey(player, 'assists')
                    matchInfo[factionpos+'_apm'] = PlayerExtractKey(player, 'actions_per_min')
                    matchInfo[factionpos+'_kpm'] = PlayerExtractKey(player, 'kills_per_min')                                               
                    matchInfo[factionpos+'_kda'] = PlayerExtractKey(player, 'kda')
                    matchInfo[factionpos+'_hero_dmg'] = PlayerExtractKey(player, 'hero_damage')
                    matchInfo[factionpos+'_gpm'] = PlayerExtractKey(player, 'gold_per_min')
                    matchInfo[factionpos+'_hero_heal'] = PlayerExtractKey(player, 'hero_healing')
                    matchInfo[factionpos+'_xpm'] = PlayerExtractKey(player, 'xp_per_min')
                    matchInfo[factionpos+'_totalgold'] = PlayerExtractKey(player, 'total_gold')
                    matchInfo[factionpos+'_totalxp'] = PlayerExtractKey(player, 'total_xp')
                    matchInfo[factionpos+'_lasthits'] = PlayerExtractKey(player, 'last_hits')
                    matchInfo[factionpos+'_denies'] = PlayerExtractKey(player, 'denies')
                    matchInfo[factionpos+'_tower_kills'] = PlayerExtractKey(player, 'tower_kills')
                    matchInfo[factionpos+'_courier_kills'] = PlayerExtractKey(player, 'courier_kills')
                    matchInfo[factionpos+'_gold_spent'] = PlayerExtractKey(player, 'gold_spent')
                    matchInfo[factionpos+'_observer_uses'] = PlayerExtractKey(player, 'observer_uses')
                    matchInfo[factionpos+'_sentry_uses'] = PlayerExtractKey(player, 'sentry_uses')
                    matchInfo[factionpos+'_ancient_kills'] = PlayerExtractKey(player, 'ancient_kills')
                    matchInfo[factionpos+'_neutral_kills'] = PlayerExtractKey(player, 'neutral_kills')
                    matchInfo[factionpos+'_camps_stacked'] = PlayerExtractKey(player, 'camps_stacked')
                    matchInfo[factionpos+'_pings'] = PlayerExtractKey(player, 'pings')
                    matchInfo[factionpos+'_rune_pickups'] = PlayerExtractKey(player, 'rune_pickups')
                    matchInfo[factionpos+'_abandons'] = PlayerExtractKey(player, 'abandons')
                    
    return matchInfo

In [12]:
from time import sleep
from itertools import chain
from collections import defaultdict
import pandas as pd


def GoThroughABlock(initialMatchID=2976775347, blockOfMatches=100):
    mainDict = {}
    
    for currentMatchID in range(initialMatchID, initialMatchID + blockOfMatches):
        host = "https://api.opendota.com/api/matches/" + str(currentMatchID)
        data = {'match_id': currentMatchID}
        data = requests.get(host, data)
        
        if data.status_code != 200:
            print "Status code for Match {0} is {1}".format(currentMatchID, data.status_code)
            continue
            
        matchJSON = json.loads(data.content)
        
        if 'lobby_type' not in matchJSON:
            print "Wrong lobby for match {0}".format(currentMatchID)
            continue
        lobby_type = matchJSON['lobby_type']
        # 0 and 7 correspond to normal and ranked
        if lobby_type != 0 and lobby_type != 7 and lobby_type != 1:
            print "Wrong lobby for match {0}".format(currentMatchID)
            continue
            
        matchPerformance = extractDotaInformation(matchJSON)       
        for k, v in matchPerformance.items():
            if k in mainDict:
                mainDict[k].append(v)
            else: 
                mainDict[k] = [v]
        sleep(0.9)
    return pd.DataFrame.from_dict(mainDict)

In [13]:
%%timeit
d = GoThroughABlock()
print d


Wrong lobby for match 2976775349
Status code for Match 2976775351 is 404
Wrong lobby for match 2976775352
Wrong lobby for match 2976775353
Wrong lobby for match 2976775355
Wrong lobby for match 2976775356
Status code for Match 2976775357 is 404
Status code for Match 2976775358 is 404
Status code for Match 2976775359 is 404
Status code for Match 2976775361 is 404
Wrong lobby for match 2976775363
Status code for Match 2976775365 is 404
Wrong lobby for match 2976775367
Status code for Match 2976775368 is 404
Status code for Match 2976775369 is 404
Wrong lobby for match 2976775370
Wrong lobby for match 2976775371
Wrong lobby for match 2976775372
Status code for Match 2976775374 is 404
Status code for Match 2976775375 is 404
Status code for Match 2976775376 is 404
Status code for Match 2976775377 is 404
Status code for Match 2976775378 is 404
Status code for Match 2976775379 is 404
Status code for Match 2976775380 is 404
Status code for Match 2976775381 is 404
Status code for Match 2976775382 is 404
Status code for Match 2976775383 is 404
Status code for Match 2976775384 is 404
Status code for Match 2976775385 is 404
Wrong lobby for match 2976775389
Wrong lobby for match 2976775394
Wrong lobby for match 2976775396
Wrong lobby for match 2976775397
Wrong lobby for match 2976775398
Wrong lobby for match 2976775399
Wrong lobby for match 2976775400
Status code for Match 2976775401 is 404
Wrong lobby for match 2976775402
Status code for Match 2976775403 is 404
Wrong lobby for match 2976775404
Status code for Match 2976775407 is 404
Wrong lobby for match 2976775410
Wrong lobby for match 2976775411
Wrong lobby for match 2976775414
Wrong lobby for match 2976775415
Wrong lobby for match 2976775416
Wrong lobby for match 2976775417
Wrong lobby for match 2976775418
Status code for Match 2976775419 is 404
Wrong lobby for match 2976775420
Wrong lobby for match 2976775424
Status code for Match 2976775428 is 404
Wrong lobby for match 2976775429
Wrong lobby for match 2976775432
Wrong lobby for match 2976775433
Wrong lobby for match 2976775435
Status code for Match 2976775436 is 429
Status code for Match 2976775437 is 429
Status code for Match 2976775438 is 429
Status code for Match 2976775439 is 429
Status code for Match 2976775440 is 429
Status code for Match 2976775441 is 429
Status code for Match 2976775442 is 429
Status code for Match 2976775443 is 429
Status code for Match 2976775444 is 429
Status code for Match 2976775445 is 429
Status code for Match 2976775446 is 429
    barracks_status_dire  barracks_status_radiant  dire_pos1  \
0                      0                       63         11   
1                     63                        0          4   
2                      0                       63         44   
3                     63                        0         44   
4                     51                       63         28   
5                      0                       63         44   
6                     63                        0         41   
7                     63                        0          1   
8                      0                       63         67   
9                     51                        0         35   
10                    63                        0         48   
11                     3                       63         93   
12                     0                       63         14   
13                     0                       63         48   
14                    63                       63          2   
15                     0                       63         35   
16                    63                        0         72   
17                    51                        0         75   
18                     0                       63         18   
19                    63                        0         48   
20                    63                        0         48   
21                     0                       63         93   
22                    60                        0         59   
23                     0                       63         44   
24                     0                       63          8   
25                     0                       51         93   
26                    63                        0         44   
27                     0                       63          8   
28                    15                        0         44   
29                     0                       63         19   
30                    63                        0        109   
31                    63                        0         93   

    dire_pos1_ancient_kills  dire_pos1_apm  dire_pos1_assists  \
0                       0.0          118.0                 11   
1                       NaN            NaN                  7   
2                       NaN            NaN                  8   
3                       NaN            NaN                 10   
4                       NaN            NaN                 14   
5                       NaN            NaN                 16   
6                       NaN            NaN                  7   
7                       NaN            NaN                 16   
8                       NaN            NaN                 20   
9                       NaN            NaN                 18   
10                      NaN            NaN                 14   
11                      NaN            NaN                  5   
12                      NaN            NaN                 13   
13                     22.0          124.0                 13   
14                      NaN            NaN                  2   
15                      NaN            NaN                 30   
16                      NaN            NaN                 16   
17                      NaN            NaN                 26   
18                      NaN            NaN                  7   
19                      NaN            NaN                 26   
20                      NaN            NaN                  5   
21                      NaN            NaN                 11   
22                      NaN            NaN                  6   
23                      NaN            NaN                  7   
24                      NaN            NaN                 14   
25                      NaN            NaN                 13   
26                      NaN            NaN                 12   
27                      NaN            NaN                  6   
28                      NaN            NaN                 12   
29                      NaN            NaN                 15   
30                      NaN            NaN                 25   
31                      NaN            NaN                 12   

    dire_pos1_camps_stacked  dire_pos1_courier_kills  dire_pos1_deaths  \
0                       0.0                      0.0                13   
1                       NaN                      NaN                 1   
2                       NaN                      NaN                14   
3                       NaN                      NaN                 4   
4                       NaN                      NaN                 1   
5                       NaN                      NaN                10   
6                       NaN                      NaN                 4   
7                       NaN                      NaN                 3   
8                       NaN                      NaN                 8   
9                       NaN                      NaN                13   
10                      NaN                      NaN                 3   
11                      NaN                      NaN                 5   
12                      NaN                      NaN                 9   
13                      0.0                      0.0                10   
14                      NaN                      NaN                 2   
15                      NaN                      NaN                 3   
16                      NaN                      NaN                 2   
17                      NaN                      NaN                13   
18                      NaN                      NaN                15   
19                      NaN                      NaN                 6   
20                      NaN                      NaN                14   
21                      NaN                      NaN                10   
22                      NaN                      NaN                16   
23                      NaN                      NaN                 9   
24                      NaN                      NaN                13   
25                      NaN                      NaN                13   
26                      NaN                      NaN                 1   
27                      NaN                      NaN                 6   
28                      NaN                      NaN                11   
29                      NaN                      NaN                10   
30                      NaN                      NaN                 6   
31                      NaN                      NaN                 4   

    dire_pos1_denies          ...           radiant_pos5_pings  \
0                  7          ...                        117.0   
1                  2          ...                          NaN   
2                  0          ...                          NaN   
3                  2          ...                          NaN   
4                  3          ...                          NaN   
5                  3          ...                          NaN   
6                  5          ...                          NaN   
7                 21          ...                          NaN   
8                  5          ...                          NaN   
9                 11          ...                          NaN   
10                 3          ...                          NaN   
11                 4          ...                          NaN   
12                 4          ...                          NaN   
13                 4          ...                          3.0   
14                 0          ...                          NaN   
15                16          ...                          NaN   
16                 0          ...                          NaN   
17                 6          ...                          NaN   
18                 2          ...                          NaN   
19                 0          ...                          NaN   
20                 2          ...                          NaN   
21                 5          ...                          NaN   
22                 3          ...                          NaN   
23                 1          ...                          NaN   
24                16          ...                          NaN   
25                 4          ...                          NaN   
26                 3          ...                          NaN   
27                 1          ...                          NaN   
28                 7          ...                          NaN   
29                 0          ...                          NaN   
30                11          ...                          NaN   
31                 5          ...                          NaN   

    radiant_pos5_rune_pickups  radiant_pos5_sentry_uses  \
0                         1.0                       2.0   
1                         NaN                       NaN   
2                         NaN                       NaN   
3                         NaN                       NaN   
4                         NaN                       NaN   
5                         NaN                       NaN   
6                         NaN                       NaN   
7                         NaN                       NaN   
8                         NaN                       NaN   
9                         NaN                       NaN   
10                        NaN                       NaN   
11                        NaN                       NaN   
12                        NaN                       NaN   
13                       12.0                       0.0   
14                        NaN                       NaN   
15                        NaN                       NaN   
16                        NaN                       NaN   
17                        NaN                       NaN   
18                        NaN                       NaN   
19                        NaN                       NaN   
20                        NaN                       NaN   
21                        NaN                       NaN   
22                        NaN                       NaN   
23                        NaN                       NaN   
24                        NaN                       NaN   
25                        NaN                       NaN   
26                        NaN                       NaN   
27                        NaN                       NaN   
28                        NaN                       NaN   
29                        NaN                       NaN   
30                        NaN                       NaN   
31                        NaN                       NaN   

    radiant_pos5_totalgold  radiant_pos5_totalxp  radiant_pos5_tower_kills  \
0                    15770                 24522                       1.0   
1                    11150                  9920                       NaN   
2                    18637                 23131                       NaN   
3                    10379                 12128                       NaN   
4                    11251                 11251                       NaN   
5                    20099                 25693                       NaN   
6                     8825                 17441                       NaN   
7                    18215                 27049                       NaN   
8                    16754                 22367                       NaN   
9                    13350                 17081                       NaN   
10                    9340                  9233                       NaN   
11                   10205                  8972                       NaN   
12                   30072                 27601                       NaN   
13                   16666                 15864                       0.0   
14                    3021                  3312                       NaN   
15                   16775                 16210                       NaN   
16                   15298                 14572                       NaN   
17                   22932                 27469                       NaN   
18                   17398                 23840                       NaN   
19                   15391                 20709                       NaN   
20                    9078                 13912                       NaN   
21                   17392                 19378                       NaN   
22                   22356                 27501                       NaN   
23                   12325                 11226                       NaN   
24                   22539                 27161                       NaN   
25                   25213                 27904                       NaN   
26                   11981                 11407                       NaN   
27                   23004                 23954                       NaN   
28                   10988                 15607                       NaN   
29                   18104                 21083                       NaN   
30                   15254                 23745                       NaN   
31                    6983                  8987                       NaN   

    radiant_pos5_xpm  radiant_win  tower_status_dire  tower_status_radiant  
0                608         True                  0                  1982  
1                258        False               2046                     0  
2                628         True                  0                  1974  
3                305        False               1983                     0  
4                378         True                262                  2047  
5                418         True                  0                  1830  
6                500        False               2038                     0  
7                493        False               1830                     0  
8                522         True                  0                  1958  
9                380         True                454                     0  
10               259        False               1972                     0  
11               291         True                  4                  1974  
12               514         True                  0                  1980  
13               455         True                  0                  1830  
14               273        False               2047                  1975  
15               287         True                  0                  1924  
16               361        False               2047                     0  
17               448        False               1540                     0  
18               581         True                  0                  1854  
19               405        False               1956                     0  
20               354        False               1974                     0  
21               517         True                  0                  1982  
22               449        False                288                     0  
23               388         True                  0                  2046  
24               523         True                  0                  2038  
25               477         True                  0                  1792  
26               338        False               2047                     0  
27               580         True                  0                  1846  
28               419        False               1590                     0  
29               460         True                  0                  2047  
30               481        False               1974                     0  
31               287        False               1983                     0  

[32 rows x 321 columns]
Status code for Match 2976775347 is 429
Status code for Match 2976775348 is 429
Status code for Match 2976775349 is 429
Status code for Match 2976775351 is 404
Wrong lobby for match 2976775352
Wrong lobby for match 2976775353
Wrong lobby for match 2976775355
Wrong lobby for match 2976775356
Status code for Match 2976775357 is 404
Status code for Match 2976775358 is 404
Status code for Match 2976775359 is 404
Status code for Match 2976775361 is 404
Wrong lobby for match 2976775363
Status code for Match 2976775365 is 404
Wrong lobby for match 2976775367
Status code for Match 2976775368 is 404
Status code for Match 2976775369 is 404
Wrong lobby for match 2976775370
Wrong lobby for match 2976775371
Wrong lobby for match 2976775372
Status code for Match 2976775374 is 404
Status code for Match 2976775375 is 404
Status code for Match 2976775376 is 404
Status code for Match 2976775377 is 404
Status code for Match 2976775378 is 404
Status code for Match 2976775379 is 404
Status code for Match 2976775380 is 404
Status code for Match 2976775381 is 404
Status code for Match 2976775382 is 404
Status code for Match 2976775383 is 404
Status code for Match 2976775384 is 404
Status code for Match 2976775385 is 404
Wrong lobby for match 2976775389
Wrong lobby for match 2976775394
Wrong lobby for match 2976775396
Wrong lobby for match 2976775397
Wrong lobby for match 2976775398
Wrong lobby for match 2976775399
Wrong lobby for match 2976775400
Status code for Match 2976775401 is 404
Wrong lobby for match 2976775402
Status code for Match 2976775403 is 404
Wrong lobby for match 2976775404
Status code for Match 2976775407 is 404
Wrong lobby for match 2976775410
Wrong lobby for match 2976775411
Wrong lobby for match 2976775414
Wrong lobby for match 2976775415
Wrong lobby for match 2976775416
Wrong lobby for match 2976775417
Wrong lobby for match 2976775418
Status code for Match 2976775419 is 404
Wrong lobby for match 2976775420
Wrong lobby for match 2976775424
Status code for Match 2976775428 is 404
Wrong lobby for match 2976775429
Wrong lobby for match 2976775432
Wrong lobby for match 2976775433
Wrong lobby for match 2976775435
Wrong lobby for match 2976775437
Status code for Match 2976775438 is 404
Status code for Match 2976775439 is 404
Status code for Match 2976775440 is 429
Status code for Match 2976775441 is 429
Status code for Match 2976775442 is 429
Status code for Match 2976775443 is 429
Status code for Match 2976775444 is 429
Status code for Match 2976775445 is 429
Status code for Match 2976775446 is 429
    barracks_status_dire  barracks_status_radiant  dire_pos1  \
0                      0                       63         44   
1                     63                        0         44   
2                     51                       63         28   
3                      0                       63         44   
4                     63                        0         41   
5                     63                        0          1   
6                      0                       63         67   
7                     51                        0         35   
8                     63                        0         48   
9                      3                       63         93   
10                     0                       63         62   
11                     0                       63         48   
12                    63                       63         90   
13                     0                       63         35   
14                    63                        0         72   
15                    51                        0         75   
16                     0                       63         18   
17                    63                        0         48   
18                    63                        0         48   
19                     0                       63         93   
20                    60                        0         63   
21                     0                       63         44   
22                     0                       63          8   
23                     0                       51         93   
24                    63                        0         44   
25                     0                       63          8   
26                    15                        0         44   
27                     0                       63         19   
28                    63                        0        109   
29                    63                        0         93   
30                     0                       51         11   

    dire_pos1_ancient_kills  dire_pos1_apm  dire_pos1_assists  \
0                       NaN            NaN                  8   
1                       NaN            NaN                 10   
2                       NaN            NaN                 14   
3                       NaN            NaN                 16   
4                       NaN            NaN                  7   
5                       NaN            NaN                 16   
6                       NaN            NaN                 20   
7                       NaN            NaN                 18   
8                       NaN            NaN                 14   
9                       NaN            NaN                  5   
10                      NaN            NaN                  9   
11                     22.0          124.0                 13   
12                      NaN            NaN                  6   
13                      NaN            NaN                 30   
14                      NaN            NaN                 16   
15                      NaN            NaN                 26   
16                      NaN            NaN                  7   
17                      NaN            NaN                 26   
18                      NaN            NaN                  5   
19                      NaN            NaN                 11   
20                      NaN            NaN                 20   
21                      NaN            NaN                  7   
22                      NaN            NaN                 14   
23                      NaN            NaN                 13   
24                      NaN            NaN                 12   
25                      NaN            NaN                  6   
26                      NaN            NaN                 12   
27                      NaN            NaN                 15   
28                      NaN            NaN                 25   
29                      NaN            NaN                 12   
30                      NaN            NaN                 18   

    dire_pos1_camps_stacked  dire_pos1_courier_kills  dire_pos1_deaths  \
0                       NaN                      NaN                14   
1                       NaN                      NaN                 4   
2                       NaN                      NaN                 1   
3                       NaN                      NaN                10   
4                       NaN                      NaN                 4   
5                       NaN                      NaN                 3   
6                       NaN                      NaN                 8   
7                       NaN                      NaN                13   
8                       NaN                      NaN                 3   
9                       NaN                      NaN                 5   
10                      NaN                      NaN                13   
11                      0.0                      0.0                10   
12                      NaN                      NaN                 0   
13                      NaN                      NaN                 3   
14                      NaN                      NaN                 2   
15                      NaN                      NaN                13   
16                      NaN                      NaN                15   
17                      NaN                      NaN                 6   
18                      NaN                      NaN                14   
19                      NaN                      NaN                10   
20                      NaN                      NaN                 6   
21                      NaN                      NaN                 9   
22                      NaN                      NaN                13   
23                      NaN                      NaN                13   
24                      NaN                      NaN                 1   
25                      NaN                      NaN                 6   
26                      NaN                      NaN                11   
27                      NaN                      NaN                10   
28                      NaN                      NaN                 6   
29                      NaN                      NaN                 4   
30                      NaN                      NaN                11   

    dire_pos1_denies          ...           radiant_pos5_pings  \
0                  0          ...                          NaN   
1                  2          ...                          NaN   
2                  3          ...                          NaN   
3                  3          ...                          NaN   
4                  5          ...                          NaN   
5                 21          ...                          NaN   
6                  5          ...                          NaN   
7                 11          ...                          NaN   
8                  3          ...                          NaN   
9                  4          ...                          NaN   
10                 0          ...                          NaN   
11                 4          ...                          3.0   
12                 5          ...                          NaN   
13                16          ...                          NaN   
14                 0          ...                          NaN   
15                 6          ...                          NaN   
16                 2          ...                          NaN   
17                 0          ...                          NaN   
18                 2          ...                          NaN   
19                 5          ...                          NaN   
20                13          ...                          NaN   
21                 1          ...                          NaN   
22                16          ...                          NaN   
23                 4          ...                          NaN   
24                 3          ...                          NaN   
25                 1          ...                          NaN   
26                 7          ...                          NaN   
27                 0          ...                          NaN   
28                11          ...                          NaN   
29                 5          ...                          NaN   
30                 2          ...                          NaN   

    radiant_pos5_rune_pickups  radiant_pos5_sentry_uses  \
0                         NaN                       NaN   
1                         NaN                       NaN   
2                         NaN                       NaN   
3                         NaN                       NaN   
4                         NaN                       NaN   
5                         NaN                       NaN   
6                         NaN                       NaN   
7                         NaN                       NaN   
8                         NaN                       NaN   
9                         NaN                       NaN   
10                        NaN                       NaN   
11                       12.0                       0.0   
12                        NaN                       NaN   
13                        NaN                       NaN   
14                        NaN                       NaN   
15                        NaN                       NaN   
16                        NaN                       NaN   
17                        NaN                       NaN   
18                        NaN                       NaN   
19                        NaN                       NaN   
20                        NaN                       NaN   
21                        NaN                       NaN   
22                        NaN                       NaN   
23                        NaN                       NaN   
24                        NaN                       NaN   
25                        NaN                       NaN   
26                        NaN                       NaN   
27                        NaN                       NaN   
28                        NaN                       NaN   
29                        NaN                       NaN   
30                        NaN                       NaN   

    radiant_pos5_totalgold  radiant_pos5_totalxp  radiant_pos5_tower_kills  \
0                    18637                 23131                       NaN   
1                    10379                 10339                       NaN   
2                    11251                 11251                       NaN   
3                    31593                 28274                       NaN   
4                     8825                 17441                       NaN   
5                    18215                 27049                       NaN   
6                    16754                 22367                       NaN   
7                    13350                 17081                       NaN   
8                     9340                  9233                       NaN   
9                    10205                  8972                       NaN   
10                   30072                 27601                       NaN   
11                   16666                 15864                       0.0   
12                    3021                  3312                       NaN   
13                   16775                 16210                       NaN   
14                   15298                 14572                       NaN   
15                   22932                 27469                       NaN   
16                   17398                 23840                       NaN   
17                   15391                 20709                       NaN   
18                    9667                 11279                       NaN   
19                   17392                 19378                       NaN   
20                   22356                 27501                       NaN   
21                   12325                 11226                       NaN   
22                   22539                 27161                       NaN   
23                   34047                 27495                       NaN   
24                   11981                 11407                       NaN   
25                   23004                 23954                       NaN   
26                   10988                 15607                       NaN   
27                   18104                 21083                       NaN   
28                   15254                 23745                       NaN   
29                    6983                  8987                       NaN   
30                   28141                 28085                       NaN   

    radiant_pos5_xpm  radiant_win  tower_status_dire  tower_status_radiant  
0                628         True                  0                  1974  
1                260        False               1983                     0  
2                378         True                262                  2047  
3                460         True                  0                  1830  
4                500        False               2038                     0  
5                493        False               1830                     0  
6                522         True                  0                  1958  
7                380         True                454                     0  
8                259        False               1972                     0  
9                291         True                  4                  1974  
10               514         True                  0                  1980  
11               455         True                  0                  1830  
12               273        False               2047                  1975  
13               287         True                  0                  1924  
14               361        False               2047                     0  
15               448        False               1540                     0  
16               581         True                  0                  1854  
17               405        False               1956                     0  
18               287        False               1974                     0  
19               517         True                  0                  1982  
20               449        False                288                     0  
21               388         True                  0                  2046  
22               523         True                  0                  2038  
23               470         True                  0                  1792  
24               338        False               2047                     0  
25               580         True                  0                  1846  
26               419        False               1590                     0  
27               460         True                  0                  2047  
28               481        False               1974                     0  
29               287        False               1983                     0  
30               499         True                  0                   256  

[31 rows x 321 columns]
Status code for Match 2976775347 is 429
Status code for Match 2976775348 is 429
Status code for Match 2976775349 is 429
Status code for Match 2976775350 is 429
Status code for Match 2976775351 is 429
Status code for Match 2976775352 is 429
Status code for Match 2976775353 is 429
Status code for Match 2976775354 is 429
Status code for Match 2976775355 is 429
Status code for Match 2976775356 is 429
Status code for Match 2976775357 is 429
Status code for Match 2976775358 is 429
Status code for Match 2976775359 is 429
Status code for Match 2976775360 is 429
Status code for Match 2976775361 is 429
Status code for Match 2976775362 is 429
Status code for Match 2976775363 is 429
Status code for Match 2976775364 is 429
Status code for Match 2976775365 is 429
Status code for Match 2976775366 is 429
Status code for Match 2976775367 is 429
Status code for Match 2976775368 is 429
Status code for Match 2976775369 is 429
Status code for Match 2976775370 is 429
Status code for Match 2976775371 is 429
Status code for Match 2976775372 is 429
Status code for Match 2976775373 is 429
Status code for Match 2976775374 is 429
Status code for Match 2976775375 is 429
Status code for Match 2976775376 is 429
Status code for Match 2976775377 is 429
Status code for Match 2976775378 is 429
Status code for Match 2976775379 is 429
Status code for Match 2976775380 is 429
Status code for Match 2976775381 is 429
Status code for Match 2976775382 is 429
Status code for Match 2976775383 is 429
Status code for Match 2976775384 is 429
Status code for Match 2976775385 is 429
Status code for Match 2976775386 is 429
Status code for Match 2976775387 is 429
Status code for Match 2976775388 is 429
Status code for Match 2976775389 is 429
Status code for Match 2976775390 is 429
Status code for Match 2976775391 is 429
Status code for Match 2976775392 is 429
Status code for Match 2976775393 is 429
Status code for Match 2976775394 is 429
Status code for Match 2976775395 is 429
Status code for Match 2976775396 is 429
Status code for Match 2976775397 is 429
Status code for Match 2976775398 is 429
Status code for Match 2976775399 is 429
Status code for Match 2976775400 is 429
Status code for Match 2976775401 is 429
Status code for Match 2976775402 is 429
Status code for Match 2976775403 is 404
Wrong lobby for match 2976775404
Status code for Match 2976775407 is 404
Wrong lobby for match 2976775410
Wrong lobby for match 2976775411
Wrong lobby for match 2976775414
Wrong lobby for match 2976775415
Wrong lobby for match 2976775416
Wrong lobby for match 2976775417
Wrong lobby for match 2976775418
Status code for Match 2976775419 is 404
Wrong lobby for match 2976775420
Wrong lobby for match 2976775424
Status code for Match 2976775428 is 404
Wrong lobby for match 2976775429
Wrong lobby for match 2976775432
Wrong lobby for match 2976775433
Wrong lobby for match 2976775435
Wrong lobby for match 2976775437
Status code for Match 2976775438 is 404
Status code for Match 2976775439 is 404
Status code for Match 2976775440 is 404
Status code for Match 2976775441 is 404
Status code for Match 2976775442 is 404
Wrong lobby for match 2976775443
Wrong lobby for match 2976775444
Wrong lobby for match 2976775445
Wrong lobby for match 2976775446
    barracks_status_dire  barracks_status_radiant  dire_pos1  \
0                     51                        0         75   
1                      0                       63         18   
2                     63                        0         48   
3                     63                        0         48   
4                      0                       63         93   
5                     60                        0         59   
6                      0                       63         44   
7                      0                       63          8   
8                      0                       51         93   
9                     63                        0         44   
10                     0                       63         61   
11                    15                        0         44   
12                     0                       63         19   
13                    63                        0        109   
14                    63                        0         93   
15                     0                       51         11   

    dire_pos1_ancient_kills  dire_pos1_apm  dire_pos1_assists  \
0                       NaN            NaN                 26   
1                       NaN            NaN                  7   
2                       NaN            NaN                 26   
3                       NaN            NaN                  5   
4                       NaN            NaN                 11   
5                       NaN            NaN                  6   
6                       NaN            NaN                  7   
7                       NaN            NaN                 14   
8                       NaN            NaN                 13   
9                       NaN            NaN                 12   
10                      NaN            NaN                  4   
11                      NaN            NaN                 12   
12                      NaN            NaN                 15   
13                      NaN            NaN                 25   
14                      NaN            NaN                 12   
15                      NaN            NaN                 18   

   dire_pos1_camps_stacked  dire_pos1_courier_kills  dire_pos1_deaths  \
0                     None                      NaN                13   
1                     None                      NaN                15   
2                     None                      NaN                 6   
3                     None                      NaN                14   
4                     None                      NaN                10   
5                     None                      NaN                16   
6                     None                      NaN                 9   
7                     None                      NaN                13   
8                     None                      NaN                13   
9                     None                      NaN                 1   
10                    None                      NaN                10   
11                    None                      NaN                11   
12                    None                      NaN                10   
13                    None                      NaN                 6   
14                    None                      NaN                 4   
15                    None                      NaN                11   

    dire_pos1_denies          ...           radiant_pos5_pings  \
0                  6          ...                         None   
1                  2          ...                         None   
2                  0          ...                         None   
3                  2          ...                         None   
4                  5          ...                         None   
5                  3          ...                         None   
6                  1          ...                         None   
7                 16          ...                         None   
8                  4          ...                         None   
9                  3          ...                         None   
10                 5          ...                         None   
11                 7          ...                         None   
12                 0          ...                         None   
13                11          ...                         None   
14                 5          ...                         None   
15                 2          ...                         None   

    radiant_pos5_rune_pickups  radiant_pos5_sentry_uses  \
0                        None                       NaN   
1                        None                       NaN   
2                        None                       NaN   
3                        None                       NaN   
4                        None                       NaN   
5                        None                       NaN   
6                        None                       NaN   
7                        None                       NaN   
8                        None                       NaN   
9                        None                       NaN   
10                       None                       NaN   
11                       None                       NaN   
12                       None                       NaN   
13                       None                       NaN   
14                       None                       NaN   
15                       None                       NaN   

    radiant_pos5_totalgold  radiant_pos5_totalxp  radiant_pos5_tower_kills  \
0                    22932                 27469                       NaN   
1                    17398                 23840                       NaN   
2                    15391                 20709                       NaN   
3                     9078                 13912                       NaN   
4                    17392                 19378                       NaN   
5                    22356                 27501                       NaN   
6                    12325                 11226                       NaN   
7                    22539                 27161                       NaN   
8                    34047                 27495                       NaN   
9                    11981                 11407                       NaN   
10                   23004                 23954                       NaN   
11                   10988                 15607                       NaN   
12                   18104                 21083                       NaN   
13                   15254                 23745                       NaN   
14                    6983                  8987                       NaN   
15                   28141                 28085                       NaN   

    radiant_pos5_xpm  radiant_win  tower_status_dire  tower_status_radiant  
0                448        False               1540                     0  
1                581         True                  0                  1854  
2                405        False               1956                     0  
3                354        False               1974                     0  
4                517         True                  0                  1982  
5                449        False                288                     0  
6                388         True                  0                  2046  
7                523         True                  0                  2038  
8                470         True                  0                  1792  
9                338        False               2047                     0  
10               580         True                  0                  1846  
11               419        False               1590                     0  
12               460         True                  0                  2047  
13               481        False               1974                     0  
14               287        False               1983                     0  
15               499         True                  0                   256  

[16 rows x 321 columns]
Wrong lobby for match 2976775349
Status code for Match 2976775351 is 404
Wrong lobby for match 2976775352
Wrong lobby for match 2976775353
Wrong lobby for match 2976775355
Wrong lobby for match 2976775356
Status code for Match 2976775357 is 404
Status code for Match 2976775358 is 404
Status code for Match 2976775359 is 404
Status code for Match 2976775361 is 404
Wrong lobby for match 2976775363
Status code for Match 2976775365 is 404
Wrong lobby for match 2976775367
Status code for Match 2976775368 is 404
Status code for Match 2976775369 is 404
Wrong lobby for match 2976775370
Wrong lobby for match 2976775371
Wrong lobby for match 2976775372
Status code for Match 2976775374 is 404
Status code for Match 2976775375 is 404
Status code for Match 2976775376 is 404
Status code for Match 2976775377 is 404
Status code for Match 2976775378 is 404
Status code for Match 2976775379 is 404
Status code for Match 2976775380 is 404
Status code for Match 2976775381 is 404
Status code for Match 2976775382 is 404
Status code for Match 2976775383 is 404
Status code for Match 2976775384 is 404
Status code for Match 2976775385 is 404
Wrong lobby for match 2976775389
Status code for Match 2976775393 is 429
Status code for Match 2976775394 is 429
Status code for Match 2976775395 is 429
Status code for Match 2976775396 is 429
Status code for Match 2976775397 is 429
Status code for Match 2976775398 is 429
Status code for Match 2976775399 is 429
Status code for Match 2976775400 is 429
Status code for Match 2976775401 is 429
Status code for Match 2976775402 is 429
Status code for Match 2976775403 is 429
Status code for Match 2976775404 is 429
Status code for Match 2976775405 is 429
Status code for Match 2976775406 is 429
Status code for Match 2976775407 is 429
Status code for Match 2976775408 is 429
Status code for Match 2976775409 is 429
Status code for Match 2976775410 is 429
Status code for Match 2976775411 is 429
Status code for Match 2976775412 is 429
Status code for Match 2976775413 is 429
Status code for Match 2976775414 is 429
Status code for Match 2976775415 is 429
Status code for Match 2976775416 is 429
Status code for Match 2976775417 is 429
Status code for Match 2976775418 is 429
Status code for Match 2976775419 is 429
Status code for Match 2976775420 is 429
Status code for Match 2976775421 is 429
Status code for Match 2976775422 is 429
Status code for Match 2976775423 is 429
Status code for Match 2976775424 is 429
Status code for Match 2976775425 is 429
Status code for Match 2976775426 is 429
Status code for Match 2976775427 is 429
Status code for Match 2976775428 is 429
Status code for Match 2976775429 is 429
Status code for Match 2976775430 is 429
Status code for Match 2976775431 is 429
Status code for Match 2976775432 is 429
Status code for Match 2976775433 is 429
Status code for Match 2976775434 is 429
Status code for Match 2976775435 is 429
Status code for Match 2976775436 is 429
Status code for Match 2976775437 is 429
Status code for Match 2976775438 is 429
Status code for Match 2976775439 is 429
Status code for Match 2976775440 is 429
Status code for Match 2976775441 is 429
Status code for Match 2976775442 is 429
Status code for Match 2976775443 is 429
Status code for Match 2976775444 is 429
Status code for Match 2976775445 is 429
Status code for Match 2976775446 is 429
    barracks_status_dire  barracks_status_radiant  dire_pos1  \
0                      0                       63         11   
1                     63                        0          4   
2                      0                       63         44   
3                     63                        0         44   
4                     51                       63         28   
5                      0                       63         44   
6                     63                        0         41   
7                     63                        0          1   
8                      0                       63         67   
9                     51                        0         35   
10                    63                        0         48   
11                     3                       63         93   
12                     0                       63         14   
13                     0                       63         48   
14                    63                       63         98   

    dire_pos1_ancient_kills  dire_pos1_apm  dire_pos1_assists  \
0                       0.0          118.0                 11   
1                       NaN            NaN                  7   
2                       NaN            NaN                  8   
3                       NaN            NaN                 10   
4                       NaN            NaN                 14   
5                       NaN            NaN                 16   
6                       NaN            NaN                  7   
7                       NaN            NaN                 16   
8                       NaN            NaN                 20   
9                       NaN            NaN                 18   
10                      NaN            NaN                 14   
11                      NaN            NaN                  5   
12                      NaN            NaN                 13   
13                     22.0          124.0                 13   
14                      NaN            NaN                  1   

    dire_pos1_camps_stacked  dire_pos1_courier_kills  dire_pos1_deaths  \
0                       0.0                      0.0                13   
1                       NaN                      NaN                 1   
2                       NaN                      NaN                14   
3                       NaN                      NaN                 4   
4                       NaN                      NaN                 1   
5                       NaN                      NaN                10   
6                       NaN                      NaN                 4   
7                       NaN                      NaN                 3   
8                       NaN                      NaN                 8   
9                       NaN                      NaN                13   
10                      NaN                      NaN                 3   
11                      NaN                      NaN                 5   
12                      NaN                      NaN                 9   
13                      0.0                      0.0                10   
14                      NaN                      NaN                 0   

    dire_pos1_denies          ...           radiant_pos5_pings  \
0                  7          ...                        117.0   
1                  2          ...                          NaN   
2                  0          ...                          NaN   
3                  2          ...                          NaN   
4                  3          ...                          NaN   
5                  3          ...                          NaN   
6                  5          ...                          NaN   
7                 21          ...                          NaN   
8                  5          ...                          NaN   
9                 11          ...                          NaN   
10                 3          ...                          NaN   
11                 4          ...                          NaN   
12                 4          ...                          NaN   
13                 4          ...                          3.0   
14                11          ...                          NaN   

    radiant_pos5_rune_pickups  radiant_pos5_sentry_uses  \
0                         1.0                       2.0   
1                         NaN                       NaN   
2                         NaN                       NaN   
3                         NaN                       NaN   
4                         NaN                       NaN   
5                         NaN                       NaN   
6                         NaN                       NaN   
7                         NaN                       NaN   
8                         NaN                       NaN   
9                         NaN                       NaN   
10                        NaN                       NaN   
11                        NaN                       NaN   
12                        NaN                       NaN   
13                       12.0                       0.0   
14                        NaN                       NaN   

    radiant_pos5_totalgold  radiant_pos5_totalxp  radiant_pos5_tower_kills  \
0                    15770                 24522                       1.0   
1                    11150                  9920                       NaN   
2                    12633                 12854                       NaN   
3                    10379                 10339                       NaN   
4                    11251                 11251                       NaN   
5                    31593                 28274                       NaN   
6                     8825                 17441                       NaN   
7                    18215                 27049                       NaN   
8                    16754                 22367                       NaN   
9                    13350                 17081                       NaN   
10                    9340                  9233                       NaN   
11                   10205                  8972                       NaN   
12                   17184                 15358                       NaN   
13                   16666                 15864                       0.0   
14                    3021                  3312                       NaN   

    radiant_pos5_xpm  radiant_win  tower_status_dire  tower_status_radiant  
0                608         True                  0                  1982  
1                258        False               2046                     0  
2                349         True                  0                  1974  
3                260        False               1983                     0  
4                378         True                262                  2047  
5                460         True                  0                  1830  
6                500        False               2038                     0  
7                493        False               1830                     0  
8                522         True                  0                  1958  
9                380         True                454                     0  
10               259        False               1972                     0  
11               291         True                  4                  1974  
12               286         True                  0                  1980  
13               455         True                  0                  1830  
14               273        False               2047                  1975  

[15 rows x 321 columns]
1 loop, best of 3: 32.6 s per loop

In [14]:
block = GoThroughABlock()


Status code for Match 2976775347 is 429
Status code for Match 2976775348 is 429
Status code for Match 2976775349 is 429
Status code for Match 2976775350 is 429
Status code for Match 2976775351 is 429
Status code for Match 2976775352 is 429
Wrong lobby for match 2976775353
Wrong lobby for match 2976775355
Wrong lobby for match 2976775356
Status code for Match 2976775357 is 404
Status code for Match 2976775358 is 404
Status code for Match 2976775359 is 404
Status code for Match 2976775361 is 404
Wrong lobby for match 2976775363
Status code for Match 2976775365 is 404
Wrong lobby for match 2976775367
Status code for Match 2976775368 is 404
Status code for Match 2976775369 is 404
Wrong lobby for match 2976775370
Wrong lobby for match 2976775371
Wrong lobby for match 2976775372
Status code for Match 2976775374 is 404
Status code for Match 2976775375 is 404
Status code for Match 2976775376 is 404
Status code for Match 2976775377 is 404
Status code for Match 2976775378 is 404
Status code for Match 2976775379 is 404
Status code for Match 2976775380 is 404
Status code for Match 2976775381 is 404
Status code for Match 2976775382 is 404
Status code for Match 2976775383 is 404
Status code for Match 2976775384 is 404
Status code for Match 2976775385 is 404
Wrong lobby for match 2976775389
Wrong lobby for match 2976775394
Wrong lobby for match 2976775396
Wrong lobby for match 2976775397
Wrong lobby for match 2976775398
Wrong lobby for match 2976775399
Wrong lobby for match 2976775400
Status code for Match 2976775401 is 404
Wrong lobby for match 2976775402
Status code for Match 2976775403 is 404
Wrong lobby for match 2976775404
Status code for Match 2976775407 is 404
Wrong lobby for match 2976775410
Wrong lobby for match 2976775411
Wrong lobby for match 2976775414
Wrong lobby for match 2976775415
Wrong lobby for match 2976775416
Wrong lobby for match 2976775417
Wrong lobby for match 2976775418
Status code for Match 2976775419 is 404
Wrong lobby for match 2976775420
Wrong lobby for match 2976775424
Status code for Match 2976775428 is 404
Wrong lobby for match 2976775429
Wrong lobby for match 2976775432
Wrong lobby for match 2976775433
Wrong lobby for match 2976775435
Wrong lobby for match 2976775437
Status code for Match 2976775438 is 404
Status code for Match 2976775439 is 404
Status code for Match 2976775440 is 404
Status code for Match 2976775441 is 404
Status code for Match 2976775442 is 404
Wrong lobby for match 2976775443
Wrong lobby for match 2976775444
Wrong lobby for match 2976775445
Wrong lobby for match 2976775446

In [15]:
# invalid field check
for column in block.columns:
    if block[column].iloc[1:len(block)].isnull().all():
        print column

In [1]:
print range(10)
print range(10, 20)


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[10, 11, 12, 13, 14, 15, 16, 17, 18, 19]

In [2]:
print len(range(10,20)) == len(range(10))


True

In [5]:
x = 13
block = 7
print range(x, x+block)
print range(x+block, x+block*2)
print range(x+block*2, x+block*3)


[13, 14, 15, 16, 17, 18, 19]
[20, 21, 22, 23, 24, 25, 26]
[27, 28, 29, 30, 31, 32, 33]

In [83]:
import pandas as pd
import numpy as np
from time import sleep

matchIdRes = pd.DataFrame(np.loadtxt('data/goodAnomaliesResidual.csv', delimiter = ','), 
                 columns = ["match_id", "residual"])

In [84]:
residualMatchesPrepDict = {}

In [85]:
for matchID in matchIdRes['match_id'].apply(lambda x: '{0:.0f}'.format(x)):
    host = "https://api.opendota.com/api/matches/" + str(matchID)
    data = {'match_id': matchID}
    data = requests.get(host, data)
        
    if data.status_code != 200:
        # print "Status code for Match {0} is {1}".format(matchID, data.status_code)
        continue
            
    matchJSON = json.loads(data.content)
        
    if 'lobby_type' not in matchJSON:
        print "Wrong lobby for match {0}".format(matchID)
        continue
    lobby_type = matchJSON['lobby_type']
        # 0 and 7 correspond to normal and ranked
    if lobby_type != 0 and lobby_type != 7 and lobby_type != 1:
        print "Wrong lobby for match {0}".format(matchID)
        continue
            
    matchPerformance = extractDotaInformation(matchJSON)       
    for k, v in matchPerformance.items():
        if k in residualMatchesPrepDict:
            residualMatchesPrepDict[k].append(v)
        else: 
            residualMatchesPrepDict[k] = [v]
    sleep(0.5)


Wrong lobby for match 3123454720
Wrong lobby for match 3123786496
Wrong lobby for match 3123754752
Wrong lobby for match 3123254528
Wrong lobby for match 3123486976
Wrong lobby for match 3123522816
Wrong lobby for match 3123601408
Wrong lobby for match 3123060480
Wrong lobby for match 3123672320
Wrong lobby for match 3123249408
Wrong lobby for match 3123235584
Wrong lobby for match 3123435520
Wrong lobby for match 3123269888

In [86]:
residualMatchesPrepDict = pd.DataFrame.from_dict(residualMatchesPrepDict)

In [87]:
residualMatchesPrepDict.columns


Out[87]:
Index([u'barracks_status_dire', u'barracks_status_radiant', u'dire_pos1',
       u'dire_pos1_abandons', u'dire_pos1_ancient_kills', u'dire_pos1_apm',
       u'dire_pos1_assists', u'dire_pos1_camps_stacked',
       u'dire_pos1_courier_kills', u'dire_pos1_deaths',
       ...
       u'radiant_pos5_pings', u'radiant_pos5_rune_pickups',
       u'radiant_pos5_sentry_uses', u'radiant_pos5_totalgold',
       u'radiant_pos5_totalxp', u'radiant_pos5_tower_kills',
       u'radiant_pos5_xpm', u'radiant_win', u'tower_status_dire',
       u'tower_status_radiant'],
      dtype='object', length=341)

In [88]:
residualMatchesPrepDict.to_csv('data/FeaturesOfResidualMatches.csv', index=False)

In [ ]: