Drops columns from the main dataframe

        :param cols: names of the columns
        :type cols: str

        :example: ``ds.drop("Col 1", "Col 2")``
967822
def drop(self, *cols):
        
        try:
            index = self.df.columns.values
            for col in cols:
                if col not in index:
                    self.warning("Column", col, "not found. Aborting")
                    return
                self.df = self.df.drop(col, axis=1)
        except Exception as e:
            self.err(e, self.drop, "Can not drop column")
1034450
def ordered_cols(self, columns, section):
        
        columns = list(columns)  # might be a tuple
        fixed_cols = [self.key]
        if section.lower() == "different":
            fixed_cols.extend([Differ.CHANGED_MATCH_KEY, Differ.CHANGED_OLD, Differ.CHANGED_NEW])
        map(columns.remove, fixed_cols)
        columns.sort()
        return fixed_cols + columns
1365973
function removeColumn(values, col, colsPerRow) {
  var n = 0;
  for (var i = 0, l = values.length; i < l; i++) {
    if (i % colsPerRow !== col) values[n++] = values[i];
  }
  values.length = n;
}
337225
def drop_columns(records, slices):
    
    for record in records:
        # Generate a set of indices to remove
        drop = set(i for slice in slices
                   for i in range(*slice.indices(len(record))))
        keep = [i not in drop for i in range(len(record))]
        record.seq = Seq(''.join(itertools.compress(record.seq, keep)), record.seq.alphabet)
        yield record
615810
def _drop_collections(self, df):
        
        all_cols = df.columns
        keep_cols = []

        # Check whether each column contains collections.
        for c in all_cols:
            if len(self._col_type_set(c, df).intersection([set, dict, list])) == 0:
                keep_cols.append(c)
        return df[keep_cols]
619050
def strip_cols(self):
        
        cols = {}
        skipped = []
        for col in self.df.columns.values:
            try:
                cols[col] = col.strip()
            except Exception:
                skipped.append(str(col))
        self.df = self.df.rename(columns=cols)
        self.ok("White spaces removed in columns names")
        if len(skipped) > 0:
            self.info("Skipped columns", ','.join(
                skipped), "while removing white spaces")
652346
def addcols(self, cols, names=None):
        
        data = spreadsheet.addcols(self, cols, names)
        data = data.view(tabarray)
        data.coloring = self.coloring
        return data
527246
def strip_columns(tab):
    """"""
    for colname in tab.colnames:
        if tab[colname].dtype.kind in ['S', 'U']:
            tab[colname] = np.core.defchararray.strip(tab[colname])
1090760
def drop_column(self, name):
        
        name = self._normalize_identifier(name)
        del self._columns[name]

        return self
302710
def get_cols(self, lines):
        
        re_name_def = re.compile(r'^\s*%\s+(?P<colname>\w+)')
        self.names = []
        for line in lines:
            if not line:  # ignore empty lines in header (windows)
                continue
            if not line.startswith('%'):  # end of header lines
                break
            match = re_name_def.search(line)
            if match:
                self.names.append(match.group('colname'))

        if not self.names:
            raise core.InconsistentTableError(
                'No column names found in Omega header')

        self.cols = []  # pylint: disable=attribute-defined-outside-init
        for name in self.names:
            col = core.Column(name=name)
            self.cols.append(col)
551598
def _by_columns(self, columns):
        
        return columns if self.isstr(columns) else self._backtick_columns(columns)
395669
public static List<Column> toColumn(List<String> columns) {
        List<Column> ret = new ArrayList<>();
        for (String s : columns)
            ret.add(col(s));
        return ret;
    }
418817
def keep_(self, *cols) -> "Ds":
        
        try:
            ds2 = self._duplicate_(self.df[list(cols)])
        except Exception as e:
            self.err(e, "Can not remove colums")
            return
        self.ok("Columns", " ,".join(cols), "kept")
        return ds2
1031193
def delete_columns(self, columns):
        
        columns = [columns] if not isinstance(columns, (list, blist)) else columns
        if not all([x in self._columns for x in columns]):
            raise ValueError('all columns must be in current columns')
        for column in columns:
            c = self._columns.index(column)
            del self._data[c]
            del self._columns[c]
        if not len(self._data):  # if all the columns have been deleted, remove index
            self.index = list()
982866
def keep(self, *cols):
        
        try:
            self.df = self.df[list(cols)]
        except Exception as e:
            self.err(e, "Can not remove colums")
            return
        self.ok("Setting dataframe to columns", " ".join(cols))
389524
function _dropColumn(){
    self._visitingAlter = true;
    var table = self._queryNode.table;
    var result=[
      'ALTER TABLE',
      self.visit(table.toNode())
    ];
    var columns='DROP ('+self.visit(alter.nodes[0].nodes[0]);
    for (var i= 1,len=alter.nodes.length; i<len; i++){
      var node=alter.nodes[i];
      assert(node.type=='DROP COLUMN',errMsg);
      columns+=', '+self.visit(node.nodes[0]);
    }
    columns+=')';
    result.push(columns);
    self._visitingAlter = false;
    return result;
  }
829883
def drop_constant_column_levels(df):
    
    columns = df.columns
    constant_levels = [i for i, level in enumerate(columns.levels) if len(level) <= 1]
    constant_levels.reverse()

    for i in constant_levels:
        columns = columns.droplevel(i)
    df.columns = columns