pub fn split(self, names: HashSet<&str>) -> (Self, Self) {
        let mut a = DataSet {
            relation: self.relation.clone(),
            columns: Vec::new(),
            n_rows: self.n_rows,
        };

        let mut b = DataSet {
            relation: self.relation.clone(),
            columns: Vec::new(),
            n_rows: self.n_rows,
        };

        for col in self.columns {
            if names.contains(col.name()) {
                b.columns.push(col);
            } else {
                a.columns.push(col);
            }
        }

        (a, b)
    }
/// move given columns into a separate data set
move given columns into a separate data set
move given columns into a separate data set
pub fn split(self, names: HashSet<&str>) -> (Self, Self) {
        let mut a = DataSet {
            relation: self.relation.clone(),
            columns: Vec::new(),
            n_rows: self.n_rows,
        };
        let mut b = DataSet {
            relation: self.relation.clone(),
            columns: Vec::new(),
            n_rows: self.n_rows,
        };
        for col in self.columns {
            if names.contains(col.name()) {
                b.columns.push(col);
            } else {
                a.columns.push(col);
            }
        }
        (a, b)
    }
pub fn split ( self , names : HashSet < & str > ) -> ( Self , Self ) { let mut a = DataSet { relation : self . relation . clone ( ) , columns : Vec :: new ( ) , n_rows : self . n_rows , } ; let mut b = DataSet { relation : self . relation . clone ( ) , columns : Vec :: new ( ) , n_rows : self . n_rows , } ; for col in self . columns { if names . contains ( col . name ( ) ) { b . columns . push ( col ) ; } else { a . columns . push ( col ) ; } } ( a , b ) }
move given columns into a separate data set
move given columns into a separate data set
self
names
HashSet<&str>
self
names
HashSet<&str>