except (AttributeError, ValueError):
// Sample is a sequence of 1D arrays.
sample = np.atleast_2d(sample).T
N, D = sample.shape
nbin = np.empty(D, int)
edges = D * [None]
After Change
result = result[core]
// Unravel binnumbers into list, with a binnumber array for each dimension
binnumber = np.asarray(np.unravel_index(xy, nbin))
if (result.shape != nbin - 2).any():
raise RuntimeError("Internal Shape Error")