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