Open Swoorup opened 2 years ago
digitize is in breeze.stats fwiw:
val x = DenseVector[Double](-0.5, 0.5, 1.5, 2, 0, 2.5)
val bins = DenseVector[Double](0.0, 1.0, 2.0)
val result = digitize(x, bins)
val desiredResult = DenseVector[Int](0, 1, 2, 2, 0, 3)
assert(result == desiredResult)
Add:
========================= I only could find linspace in this library. The above would be great to have, working with data binning and histograms.