In [1]:
import numpy as np
import pandas as pd

from atod import Hero, Heroes, Ability, Abilities

Heroes initialisation

there are 3 ways to create Heroes object:

  1. Heroes.from\_ids() -- takes list of ids as the argument
  2. Heroes.from\_names(h) -- takes list of names as the argument
  3. Heroes() -- takes list of Hero objects as the argument

In [2]:
pick = Heroes.from_ids([1, 5, 28, 65, 12])


['Anti-Mage', 'Crystal Maiden', 'Slardar', 'Batrider', 'Phantom Lancer']
Anti-Mage          1
Batrider          65
Crystal Maiden     5
Phantom Lancer    12
Slardar           28
dtype: int64

Basic information

with this functions you can get some basic information about set of heroes in the object.


In [8]:
print('Names =', pick.get_names(), '\n')

print('IDs:')
print(pick.get_ids())


Names = ['Anti-Mage', 'Crystal Maiden', 'Slardar', 'Batrider', 'Phantom Lancer'] 

IDs:
Anti-Mage          1
Batrider          65
Crystal Maiden     5
Phantom Lancer    12
Slardar           28
dtype: int64

In the few papers I read about DotA binary encoded set of heroes ids were used to represent pick. get_ids() with binarised=True returns One-Hot encoded heroes ids on the vector of all the heroes ids.


In [3]:
print(pick.get_ids(binarised=True).shape[0])


113

get_description() works the same way it does for single Hero, except name and id columns will be removed from description, because result is the sum of parameters between heroes in the Heroes object.


In [5]:
print(pick.get_description(include=['laning', 'role']))


category  var             
laning    requires_farm       5
          requires_setup      5
          requires_babysit    5
          provides_setup      8
          solo_desire         2
          survival_rating     4
          provides_babysit    8
role      disabler            5
          nuker               4
          escape              7
          durable             2
          initiator           5
          pusher              1
          support             3
          jungler             3
          carry               7
dtype: int64