def elo_update(scores, winner, loser, xi=400, k=100):
    """ Update a given Elo-Ranking

    Parameters
    ----------
    scores : ndarray
        current Elo scores
    winner : int
        index of winning team
    loser : int
        index of loosing team
    xi : float, optional
        Scaling factor applied in sigmoid function
    k : float, optional
        Update factor
    """

    def get_mu(team1, team2):
        dij = scores[team1] - scores[team2]
        return 1/(1 + 10**(-dij/xi))
    
    mu_winner = get_mu(winner, loser)
    mu_loser  = get_mu(loser, winner)
    
    scores[winner] += k * (1 - mu_winner)
    scores[loser]  += k * (0 - mu_loser)