Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to use the histogram if the min/max is not known on compile time? #67

Open
selvavm opened this issue Jun 19, 2020 · 1 comment
Open

Comments

@selvavm
Copy link

selvavm commented Jun 19, 2020

I am not sure if this is a right place to ask this question. First, thanks for your contribution.
I am having n time series of Vec<f32> and I want to get a histogram Count of m (usually 50) bins. In python, there is a possibility to say the number of bins needed and is it possible to do in rust?

My next problem is, I don’t know the observation values during compile time so I can’t build the grid beforehand. Is it possible to redefine the grid once added.

For example, I initiate an empty histogram, and add observations in a loop ( the loop will be a concat of multiple time series until merge pr is ready :) ). Then I say the bin count (say 50). It should distribute the bin range with 50 bins based on the min/max. Is this possible?

My use case can be solved using HdrHistogram but it supports only u64 and not f32. Also, in my application I already use ndarray, so felt this crate will fit very well.

Note: I am new to rust

@nilgoyette
Copy link
Contributor

Sorry for the late answer (6 months later). If it's too late or you have found a solution, can you please close this issue?

I have never used Histogram myself, but looking at this example, there's nothing that need to be "hardcoded" or set at "compile time". The example does show only n64 floats, but noisy_float also provides n32.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants