We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Histogram function would be very helpful. Bonus points if it has a overload that allows for explicitly setting the bins with an array/range.
The text was updated successfully, but these errors were encountered:
auto hist(Range)(Range data, uint bins) if (isForwardRange!Range) { immutable minimum = data .save .reduce!min .floor .lround; immutable maximum = data .save .reduce!max .ceil .lround; immutable bin_width = (maximum - minimum) / bins; auto results = iota(0, bins + 1) .map!(a => tuple(double(0), minimum + (bin_width * a))) .array; foreach (item; data) { immutable bin = (lround(item) - minimum) / bin_width; results[bin][0]++; } return results; }
Sorry, something went wrong.
No branches or pull requests
Histogram function would be very helpful. Bonus points if it has a overload that allows for explicitly setting the bins with an array/range.
The text was updated successfully, but these errors were encountered: