def mapped_actors(data):
    """ 
    Creates a mapping of actors to whom they have acted with.
    Returns a dictionary of form {actor_id_1: {actor_id_2}}
    """ 
    
    d = {}
    
    # Map actor_1 to actor_2 and actor_2 to actor_1
    for i in data:
        if i[0] not in d:
            d[i[0]] = set() 
        d[i[0]].add(i[1])
        
        if i[1] not in d:
            d[i[1]] = set() 
        d[i[1]].add(i[0]) 
    return d