This should do what you want:
x = rand(1000,3) h = fit(Histogram, Tuple(eachcol(x)); nbins=(40, 5, 9)) bin_ids = map(xi -> StatsBase.binindex(h, Tuple(xi)), eachrow(x))