Wasserstein distance for histograms

How can one compute the Wasserstein distance between two histograms.
To be clear, what I mean with a histogram is, e.g., the following h :
using StatsBase
x = randn(10^4)
h = fit(Histogram, x)
Looking forward to any suggestion.

Including calling Python’s wasserstein_distance()?

The trick was to get the right synonym for Wasserstein distance. In this case earth mover distance. A little google gives:


and following the instructions on the README I was able to calculate a distance.
Thanks mirkobunse (Mirko Bunse).

Also, this thread might be relevant:

1 Like