Entropy Balancing Python