Looking at the comments for the code behind scipy.stats.wasserstein_distance which invokes a function called _cdf_distance(p, u_values, v_values, u_weight
scipy.stats.wasserstein_distance
_cdf_distance(p, u_values, v_values, u_weight