Exemplo n.º 1
0
 def getActorAge(self, actorNodes, actorName):
     for node in actorNodes:
         if (ActorNode.getName(node) == actorName):
             if ActorNode.getAge(node) == '2017':
                 return 'Died'
             else:
                 return ActorNode.getAge(node)
Exemplo n.º 2
0
 def getOldestActor(self, actorNodes):
     maxAge = 0
     act = ''
     for node in actorNodes:
         if (int(ActorNode.getAge(node)) > maxAge):
             maxAge = int(ActorNode.getAge(node))
             act = ActorNode.getName(node)
     return act
Exemplo n.º 3
0
def show_age_gross_relation():
    ret = {}
    for film in InitGraph.filmNodes:
        if film is not None:
            value = FilmNode.getValue(film)
            name = FilmNode.getName(film)
            actors = GraphQuery.getActorsInFilm(GraphQuery(),
                                                InitGraph.filmNameDict, name)
            for actor in actors:
                if actor is not None:
                    for node in InitGraph.actorNodes:
                        if ActorNode.getName(node) == actor:
                            ret[ActorNode.getAge(node)] = value

    trace = go.Pie(labels=list(ret.keys()), values=list(ret.values()))
    py.plot([trace], filename='basic_pie_chart')