You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Ok, that optimization should work in the common cases. However, it's still cloning before converting to an f64, rather than converting from a reference to the data. You'll have to suggest to people to impl ToPrimitive for &'a Bigdata if for some reason they have a Bigdata type that converts to a primitive and want stats.
More broadly: I don't really have a good vision for this crate. My hope is that something more cohesive takes its place, but I'm not really the right person to lead that charge. I should probably put that in the README.
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
. ButToPrimitive
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 likemean(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.The text was updated successfully, but these errors were encountered: