Skip to content

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

Open
@selvavm

Description

@selvavm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions