pub fn rand_normal(name: &str, length: usize, mean: f64, std_dev: f64) -> Result<Self> {
        let normal = match Normal::new(mean, std_dev) {
            Ok(dist) => dist,
            Err(e) => return Err(PolarsError::RandError(format!("{:?}", e))),
        };
        let mut builder = PrimitiveChunkedBuilder::<T>::new(name, length);
        let mut rng = rand::thread_rng();
        for _ in 0..length {
            let smpl = normal.sample(&mut rng);
            let smpl = NumCast::from(smpl).unwrap();
            builder.append_value(smpl)
        }
        Ok(builder.finish())
    }
/// Create `ChunkedArray` with samples from a Normal distribution.
Create `ChunkedArray` with samples from a Normal distribution.
Create ` ChunkedArray ` with samples from a Normal distribution .
pub fn rand_normal(name: &str, length: usize, mean: f64, std_dev: f64) -> Result<Self> {
        let normal = match Normal::new(mean, std_dev) {
            Ok(dist) => dist,
            Err(e) => return Err(PolarsError::RandError(format!("{:?}", e))),
        };
        let mut builder = PrimitiveChunkedBuilder::<T>::new(name, length);
        let mut rng = rand::thread_rng();
        for _ in 0..length {
            let smpl = normal.sample(&mut rng);
            let smpl = NumCast::from(smpl).unwrap();
            builder.append_value(smpl)
        }
        Ok(builder.finish())
    }
pub fn rand_normal ( name : & str , length : usize , mean : f64 , std_dev : f64 ) -> Result < Self > { let normal = match Normal :: new ( mean , std_dev ) { Ok ( dist ) => dist , Err ( e ) => return Err ( PolarsError :: RandError ( format ! ( " " e ) ) ) , } ; let mut builder = PrimitiveChunkedBuilder :: < T > :: new ( name , length ) ; let mut rng = rand :: thread_rng ( ) ; for _ in 0 .. length { let smpl = normal . sample ( & mut rng ) ; let smpl = NumCast :: from ( smpl ) . unwrap ( ) ; builder . append_value ( smpl ) } Ok ( builder . finish ( ) ) }
Create `ChunkedArray` with samples from a Normal distribution.
Create ` ChunkedArray ` with samples from a Normal distribution .
name
&str
length
usize
mean
f64
std_dev
f64
name
&str
length
usize
mean
f64
std_dev
f64