Crate similar to C++ boost::accumulator?

User's Guide - 1.78.0 computes incremental statistics, e.g., one can keep adding value to an accumulator and query statistics such as mean, median etc.

Is there something similar in Rust?

I don't know if there is a ready made crate which does this, but it should only take 50 lines or so to implement. You just need to create an iterator adapted which does the state tracking while still yielding values.

Thanks for the keywords. Just did a search and found many useful patterns. rust - How do I implement an Iterator adapter only for iterators with a specific Item? - Stack Overflow was helpful.

Just starting with rust after giving up on C++/Windows and, and after a while Nim's errors messages were not very helpful.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.