BurntSushi / BurntSushi/rust-stats
Support non-consuming operations
- Dominant language
- Rust
- Stars
- 89
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
I'm calculating both mean and stddev on some data, but I find that I have to clone my data vec to do it. The functions as they are consume an iterator, whose item type must implement `ToPrimitive`. But `ToPrimitive` is not defined over `&i32` and the like, so I can't use, for example, `mean(vec![1,2,3].iter())`. I had to use something like `mean(vec![1,2,3].clone().into_iter()`. I had small examples, but I think you want this library to scale, and cloning data to calculate stats won't scale.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the mean and stddev functions and their ToPrimitive iterator bounds. Check how iterator items are consumed and whether references such as &i32 are supported, then verify that calculating statistics from vec![1,2,3].iter() works without cloning the data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100