Exclude one or more fields from feature fields.

        :rtype: DataFrame
188843
def exclude_fields(self, *args):
        
        if not args:
            raise ValueError("Field list cannot be None.")
        new_df = copy_df(self)
        fields = _render_field_set(args)
        self._assert_ml_fields_valid(*fields)
        new_df._perform_operation(op.ExcludeFieldsOperation(fields))
        return new_df
1094469
def remove_field(self, name):
        
        field = self.get_field(name)
        if field:
            predicat = lambda field: field.get('name') != name
            self.__current_descriptor['fields'] = filter(
                predicat, self.__current_descriptor['fields'])
            self.__build()
        return field
506501
def _exclude_on_fail(self, df):
        """"""
        idx = df if isinstance(df, pd.MultiIndex) else _meta_idx(df)
        self.meta.loc[idx, 'exclude'] = True
        logger().info('{} non-valid scenario{} will be excluded'
                      .format(len(idx), '' if len(idx) == 1 else 's'))
596497
def hide_defaults(self):
        """"""
        for k in list(self.fields.keys()):
            if k in self.default_fields:
                if self.default_fields[k] == self.fields[k]:
                    del(self.fields[k])
        self.payload.hide_defaults()
518830
def wherenot(self, fieldname, value):
        
        return self.where(fieldname, value, negate=True)
828684
def filter_exclude(df, s):
    
    keep = ~np.array( [s in c for c in df.columns.values] )
    return df.iloc[:, keep]
844972
def get_search_fields(self, exclude=None):
        
        exclude = set(exclude)
        if self.search_fields and len(self.search_fields) > 1:
            exclude = exclude.union(self.search_fields)

        return self.get_filter_fields(exclude=exclude)
1020180
def filter_fields(self, fields=[], exclude=[], include_all_if_empty=True):
        
        if not include_all_if_empty and not fields:
            return []
        ret = []
        for f in self.visible_fields():
            if fields and f.name not in fields:
                continue
            if exclude and f.name in exclude:
                continue
            ret.append(f)
        return ret
45887
def validatefeatures(self,features):
        """"""
        validatedfeatures = []
        for feature in features:
            if isinstance(feature, int) or isinstance(feature, float):
                validatedfeatures.append( str(feature) )
            elif self.delimiter in feature and not self.sklearn:
                raise ValueError("Feature contains delimiter: " + feature)
            elif self.sklearn and isinstance(feature, str): #then is sparse added together
                validatedfeatures.append(feature)
            else:
                validatedfeatures.append(feature)
        return validatedfeatures
109264
def restrict(self, support):
        
        if self.has_been_restricted == True:
            return self

        new_numerical_cols = []
        new_categorical_cols = []
        new_additional_numerical_cols = []
        new_feature_names = []
        new_vocab = {}

        for idx, val in enumerate(support):
            if val == True:
                feature_name = self.feature_names_[idx]
                if self.separator in feature_name:
                    base_feature_name = feature_name[:feature_name.rfind(self.separator)]
                else:
                    base_feature_name = feature_name
                new_feature_names.append(feature_name)
                new_vocab[feature_name] = len(new_vocab)
                if feature_name in self.numerical_columns:
                    new_numerical_cols.append(feature_name)
                elif base_feature_name in self.categorical_columns and base_feature_name not in new_categorical_cols:
                    new_categorical_cols.append(base_feature_name)
                elif feature_name in self.additional_numerical_cols:
                    new_additional_numerical_cols.append(feature_name)

        self.feature_names_ = new_feature_names
        self.vocabulary_ = new_vocab
        self.numerical_columns = new_numerical_cols
        self.categorical_columns = new_categorical_cols
        self.additional_numerical_cols = new_additional_numerical_cols

        self.has_been_restricted = True
        return self
882083
def fields(self):
        
        if 'feature' in self._dict:
            self._attributes = self._dict['feature']['attributes']
        else:
            self._attributes = self._dict['attributes']
        return self._attributes.keys()
771512
def remove_all_custom_funcs(self):
        
        custom_feats = [f for f in self.active_features if isinstance(f, CustomFeature)]
        for f in custom_feats:
            self.active_features.remove(f)
106075
def features(self):
        """"""
        mycols = []
        for col in dfn.feature_names:
            if col in self:
                mycols.append(col)
        mycols.sort()
        return mycols
653412
def clear(self):
        ""
        if isinstance(self.data, np.ndarray):
            data = self.data[:, :0]
        elif util.pd and isinstance(self.data, util.pd.DataFrame):
            data = self.data.iloc[:0]
        elif isinstance(self.data, dict):
            data = {k: v[:0] for k, v in self.data.items()}
        with util.disable_constant(self):
            self.data = data
        self.send(data)
89733
def get_filter_fields(self, exclude=None):
        

        exclude_set = set(self.exclude)
        if exclude:
            exclude_set = exclude_set.union(set(exclude))

        return [name for name in self.fields
                if name not in exclude_set]
1049381
def remove_spot(self, feature=None, **kwargs):
        
        kwargs.setdefault('kind', 'spot')
        return self.remove_feature(feature, **kwargs)
858045
def feature_path_unset(self):
        """"""
        if not self.feature_file:
            raise IOError('No feature file to unset')

        with open(self.feature_path) as handle:
            feats = list(GFF.parse(handle))
            if len(feats) > 1:
                log.warning('Too many sequences in GFF')
            else:
                tmp = feats[0].features

        self.feature_dir = None
        self.feature_file = None
        self.features = tmp