k as np.float64 to avoid problems with np.histogram