Select features to plot.

        feature_index is always used as the filter and
        if filter_names is supplied, a new feature_index
        is computed from those names.
773762
def _select_features_to_plot(self, X):
        
        if self.feature_index:
            if self.feature_names:
                raise YellowbrickWarning(
                    'Both feature_index and feature_names '
                    'are specified. feature_names is ignored'
                )
            if (min(self.feature_index) < 0
                    or max(self.feature_index) >= X.shape[1]):
                raise YellowbrickValueError('Feature index is out of range')
        elif self.feature_names:
            self.feature_index = []
            features_list = self.features_.tolist()
            for feature_name in self.feature_names:
                try:
                    self.feature_index.append(
                        features_list.index(feature_name)
                    )
                except ValueError:
                    raise YellowbrickValueError(
                        '{} not in labels'.format(feature_name)
                    )
313584
def select(self, axis, index, force_copy: bool = False):
        """"""
        if axis == 0:
            if index == slice(None) and not force_copy:
                return self
            return self[index]
        else:
            raise ValueError("In Histogram1D.select(), axis must be 0.")
123467
private StyleFilter findStyleFilter(Object feature, List<StyleFilter> styles) {
		for (StyleFilter styleFilter : styles) {
			if (styleFilter.getFilter().evaluate(feature)) {
				return styleFilter;
			}
		}
		return new StyleFilterImpl();
	}
957674
def on_plot_select(self,event):
        
        if not self.xdata or not self.ydata: return
        pos=event.GetPosition()
        width, height = self.canvas.get_width_height()
        pos[1] = height - pos[1]
        xpick_data,ypick_data = pos
        xdata_org = self.xdata
        ydata_org = self.ydata
        data_corrected = self.map.transData.transform(vstack([xdata_org,ydata_org]).T)
        xdata,ydata = data_corrected.T
        xdata = list(map(float,xdata))
        ydata = list(map(float,ydata))
        e = 4e0

        index = None
        for i,(x,y) in enumerate(zip(xdata,ydata)):
            if 0 < sqrt((x-xpick_data)**2. + (y-ypick_data)**2.) < e:
                index = i
                break
        if index==None: print("Couldn't find point %.1f,%.1f"%(xpick_data,ypick_data))

        self.change_selected(index)
650833
def pass_feature(*feature_names):
    
    def decorator(f):
        @functools.wraps(f)
        def wrapper(*args, **kwargs):
            for name in feature_names:
                kwargs[name] = feature_proxy(name)
            return f(*args, **kwargs)
        return wrapper
    return decorator
595530
def select(cls, dataset, selection_mask=None, **selection):
        
        import iris
        constraint = cls.select_to_constraint(dataset, selection)
        pre_dim_coords = [c.name() for c in dataset.data.dim_coords]
        indexed = cls.indexed(dataset, selection)
        extracted = dataset.data.extract(constraint)
        if indexed and not extracted.dim_coords:
            return extracted.data.item()
        post_dim_coords = [c.name() for c in extracted.dim_coords]
        dropped = [c for c in pre_dim_coords if c not in post_dim_coords]
        for d in dropped:
            extracted = iris.util.new_axis(extracted, d)

        return extracted
776142
def index(name)
      indices[name] = Index.new(name) unless indices.include?(name)
    end
1174594
function(id, name, index) {
    if(!this.config.selectOnHover) return;
    var s = this.selected;
    if(s.id != id || s.name != name 
        || s.index != index) {
      s.id = id;
      s.name = name;
      s.index = index;
      this.st.graph.eachNode(function(n) {
        n.setData('border', false);
      });
      if(id) {
        var n = this.st.graph.getNode(id);
        n.setData('border', s);
        var link = index === 0? 'prev':'next';
        link = n.getData(link);
        if(link) {
          n = this.st.graph.getByName(link);
          if(n) {
            n.setData('border', {
              name: name,
              index: 1-index
            });
          }
        }
      }
      this.st.plot();
    }
  }
713310
def check(self, feature):
        
        mapper = feature.as_dataframe_mapper()
        X = mapper.fit_transform(self.X, y=self.y)
        assert self.X.shape[0] == X.shape[0]
106075
def features(self):
        """"""
        mycols = []
        for col in dfn.feature_names:
            if col in self:
                mycols.append(col)
        mycols.sort()
        return mycols
318431
def selected_indexes(self, ):
        
        i = self.model().index(self.currentIndex(), 0, self.rootModelIndex())
        return [i]
841848
def subplot(self, index_x, index_y):
        
        self._active_renderer_index = self.loc_to_index((index_x, index_y))
274790
def plot_filter_transmissions(log, filterList):
    
    ################ > IMPORTS ################
    ## STANDARD LIB ##
    ## THIRD PARTY ##
    import matplotlib.pyplot as plt
    import numpy as np
    ## LOCAL APPLICATION ##

    ################ > VARIABLE SETTINGS ######
    ################ >ACTION(S) ################
    for filterFile in filterList:
        data = np.genfromtxt(filterFile)
        plt.plot(data[:, 0], data[:, 1])

    plt.show()
    return
836403
def _selectItem(self, index):
        
        self._selectedIndex = index
        self.setCurrentIndex(self.model().createIndex(index, 0))
211297
def _apply_features_filter(self, station_codes):
        
        # apply features filter
        if hasattr(self, "features") and self.features is not None:
            station_codes = set(station_codes)
            station_codes = list(
                station_codes.intersection(set(self.features))
            )

        return station_codes
1193690
def query(
            self,
            select_column_names,
            filter_column,
            filter_value,
            feature,
            distinct=False,
            required=False):
        
        sql = """
            SELECT %s%s
            FROM %s
            WHERE %s = ?
        """ % ("distinct " if distinct else "",
               ", ".join(select_column_names),
               feature,
               filter_column)
        query_params = [filter_value]
        return self.run_sql_query(
            sql, required=required, query_params=query_params)
97720
def y_select_cb(self, w, index):
        """"""
        try:
            self.y_col = self.cols[index]
        except IndexError as e:
            self.logger.error(str(e))
        else:
            self.plot_two_columns(reset_ylimits=True)