pub fn take_opt_iter<I>(&self, iter: I, capacity: Option<usize>) -> Self
    where
        I: Iterator<Item = Option<usize>> + Clone + Sync,
    {
        let new_col = self
            .columns
            .par_iter()
            .map(|s| {
                let mut i = iter.clone();
                s.take_opt_iter(&mut i, capacity)
            })
            .collect();
        DataFrame::new_no_checks(new_col)
    }
/// Take DataFrame values by indexes from an iterator that may contain None values.
///
/// # Example
///
/// ```
/// use polars::prelude::*;
/// fn example(df: &DataFrame) -> DataFrame {
///     let iterator = (0..9).into_iter().map(Some);
///     df.take_opt_iter(iterator, None)
/// }
/// ```
/// # Safety
///
/// This doesn't do any bound checking. Out of bounds may access uninitialized memory.
/// Null validity is checked
Take DataFrame values by indexes from an iterator that may contain None values.
Take DataFrame values by indexes from an iterator that may contain None values .
pub fn take_opt_iter<I>(&self, iter: I, capacity: Option<usize>) -> Self
    where
        I: Iterator<Item = Option<usize>> + Clone + Sync,
    {
        let new_col = self
            .columns
            .par_iter()
            .map(|s| {
                let mut i = iter.clone();
                s.take_opt_iter(&mut i, capacity)
            })
            .collect();
        DataFrame::new_no_checks(new_col)
    }
pub fn take_opt_iter < I > ( & self , iter : I , capacity : Option < usize > ) -> Self where I : Iterator < Item = Option < usize > > + Clone + Sync , { let new_col = self . columns . par_iter ( ) . map ( | s | { let mut i = iter . clone ( ) ; s . take_opt_iter ( & mut i , capacity ) } ) . collect ( ) ; DataFrame :: new_no_checks ( new_col ) }
Take DataFrame values by indexes from an iterator that may contain None values.
Take DataFrame values by indexes from an iterator that may contain None values .
&self
iter
I
capacity
Option<usize>
&self
iter
I
capacity
Option<usize>
example
```
use polars::prelude::*;
fn example(df: &DataFrame) -> DataFrame {
let iterator = (0..9).into_iter().map(Some);
df.take_opt_iter(iterator, None)
}
```
` ` ` use polars :: prelude :: * ; fn example ( df : &DataFrame ) - > DataFrame { let iterator = ( 0 .. 9 ) . into_iter () . map ( Some ) ; df . take_opt_iter ( iterator None ) } ` ` `
safety
This doesn't do any bound checking. Out of bounds may access uninitialized memory.
Null validity is checked
This doesn ' t do any bound checking . Out of bounds may access uninitialized memory . Null validity is checked