Remove rows and cols that have no assigned measurements.
        Return new instance.
542371
def dropna(self):
        '''
        
        '''
        new = self.copy()
        tmp = self._dict2DF(self, nan, True)
        new.row_labels = list(tmp.index)
        new.col_labels = list(tmp.columns)
        return new
953619
def removeColumns(self, columnNames):
        
        model = self.tableView.model()

        if model is not None:
            model.removeDataFrameColumns(columnNames)

        self.removeColumnButton.setChecked(False)
521633
private void removeDominatedColumns(DoubleMatrix1D c,
			DoubleMatrix2D A, DoubleMatrix1D b, 
			DoubleMatrix1D lb, DoubleMatrix1D ub, 
			DoubleMatrix1D ylb, DoubleMatrix1D yub,
			DoubleMatrix1D zlb, DoubleMatrix1D zub) {
		for(short col=0; col<this.vColPositions.length; col++){
			short[] vColPositionsCol = vColPositions[col];
			if(vColPositionsCol==null || vColPositionsCol.length==0){
				continue;
			}
			double e = 0.;
			double d = 0.;
			//it will be e <= d
			for(int i=0; i<vColPositionsCol.length; i++){
				short row = vColPositionsCol[i]; 
				double AIJ = A.getQuick(row, col);
				if(AIJ > 0){
					e += AIJ * ylb.getQuick(row); 
					d += AIJ * yub.getQuick(row);
				}else{
					e += AIJ * yub.getQuick(row); 
					d += AIJ * ylb.getQuick(row);
				}
			}
			
			double cmd = c.getQuick(col) - d;
			double cme = c.getQuick(col) - e;
			//logger.debug("cmd: " +cmd);
			//logger.debug("cme: " +cme);
			boolean isCmdPositive = cmd > 0 && !isZero(cmd);//strictly > 0
			boolean isCmeNegative = cme < 0 && !isZero(cme);//strictly < 0
			boolean isLBColUnbounded = isLBUnbounded(lb.getQuick(col));
			boolean isUBColUnbounded = isUBUnbounded(ub.getQuick(col));
			
			if(isCmdPositive || isCmeNegative){
			  //dominated column
				log.debug("found dominated column: " + col);
				if(isCmdPositive){
					zlb.setQuick(col, 0);
					if(isLBColUnbounded){
						log.debug("unbounded problem");
						throw new RuntimeException("unbounded problem");
					}
					ub.setQuick(col, lb.getQuick(col));
					log.debug("x[" + col + "]="+lb.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, lb.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
				}else if(isCmeNegative){
					zub.setQuick(col, 0);
					if(isUBColUnbounded){
						log.debug("unbounded problem");
						throw new RuntimeException("unbounded problem");
					}
					lb.setQuick(col, ub.getQuick(col));
					log.debug("x[" + col + "]="+ub.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, ub.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
				}
				continue;
			}
			
			//here we have cmd<=0 and cme>=0 (can even be unbounded)
			
			if(vColPositionsCol.length>1){//the column singletons are used to generate the bounds d and e and therefore they cannot be dropped with this test
				if(!isLBColUnbounded && isZero(cmd)){	
					//weakly dominated column, see A. & A. (27), (28)
					log.debug("found weakly dominated column: " + col);
					ub.setQuick(col, lb.getQuick(col));
					log.debug("x[" + col + "]="+lb.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, lb.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
					continue;
				}
				if(!isUBColUnbounded && isZero(cme)){	
					//weakly dominated column, see A. & A. (27), (28)
					log.debug("found weakly dominated column: " + col);
					lb.setQuick(col, ub.getQuick(col));
					log.debug("x[" + col + "]="+ub.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, ub.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
					continue;
				}
			}
			
			if(!isLBColUnbounded && isUBColUnbounded){
				//new bounds on the optimal Lagrange multipliers y
				for(int i=0; i<vColPositionsCol.length; i++){
					short row = vColPositionsCol[i]; 
					double AIJ = A.getQuick(row, col);
					if(AIJ > 0){
						if(!isUBUnbounded(cme/AIJ + ylb.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							yub.setQuick(row, Math.min(yub.getQuick(row), cme/AIJ + ylb.getQuick(row)));
						}
					}else{
						if(!isLBUnbounded(cme/AIJ + yub.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							ylb.setQuick(row, Math.max(ylb.getQuick(row), cme/AIJ + yub.getQuick(row)));
						}
					}
				}
			}
			if(isLBColUnbounded && !isUBColUnbounded){
			  //new bounds on the optimal Lagrange multipliers y
				for(int i=0; i<vColPositionsCol.length; i++){
					short row = vColPositionsCol[i]; 
					double AIJ = A.getQuick(row, col);
					if(AIJ > 0){
						if(!isLBUnbounded(cmd/AIJ + yub.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							ylb.setQuick(row, Math.max(ylb.getQuick(row), cmd/AIJ + yub.getQuick(row)));
						}
					}else{
						if(!isUBUnbounded(cmd/AIJ + ylb.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							yub.setQuick(row, Math.min(yub.getQuick(row), cmd/AIJ + ylb.getQuick(row)));
						}
					}
				}
			}
		}
	}
717460
public static void removeEqualRows(DenseMatrix64F matrix)
    {
        int rows = matrix.numRows;
        if (rows < 2)
        {
            return;
        }
        double[] d = matrix.data;
        int cols = matrix.numCols;
        int left = rows-1;
        int delta = 0;
        for (int i=0;i<left;i++)
        {
            int j=i;
            for (;j<left && eq(d, i, j+1, cols);j++);
            if (i != j)
            {
                int cnt = j-i;
                System.arraycopy(d, cols*j, d, cols*i, cols*(left-j+1));
                left -= cnt;
                delta += cnt;
            }
        }
        if (eq(d, 0, rows-1, cols))
        {
            delta++;
        }
        if (delta > 0)
        {
            matrix.reshape(rows-delta, cols, true);
        }
    }
283531
public static DataRowsFacade zeromeanUnitVariance(DataRowsFacade frame, List<String> skipColumns) {
        List<String> columnsList = DataFrames.toList(frame.get().columns());
        columnsList.removeAll(skipColumns);
        String[] columnNames = DataFrames.toArray(columnsList);
        //first row is std second row is mean, each column in a row is for a particular column
        List<Row> stdDevMean = stdDevMeanColumns(frame, columnNames);
        for (int i = 0; i < columnNames.length; i++) {
            String columnName = columnNames[i];
            double std = ((Number) stdDevMean.get(0).get(i)).doubleValue();
            double mean = ((Number) stdDevMean.get(1).get(i)).doubleValue();
            if (std == 0.0)
                std = 1; //All same value -> (x-x)/1 = 0

            frame = dataRows(frame.get().withColumn(columnName, frame.get().col(columnName).minus(mean).divide(std)));
        }



        return frame;
    }
1066080
def csv_column_cleaner(rows):
    

    # check columns if there was empty columns
    result = [[] for x in range(0, len(rows))]
    for i_index in range(0, len(rows[0])):

        partial_values = []

        for x_row in rows:
            partial_values.append(
                x_row[i_index] if len(x_row) > i_index else '')

        colum_rows = exclude_empty_values(partial_values)

        if len(colum_rows) > len(rows) / 5:  # adjust this value
            for index in range(0, len(rows)):
                result[index].append(
                    rows[index][i_index] if len(rows[index]) > i_index else '')
    return result
218903
def OnDeleteCols(self, event):
        """"""

        bbox = self.grid.selection.get_bbox()

        if bbox is None or bbox[1][1] is None:
            # Insert rows at cursor
            del_point = self.grid.actions.cursor[1]
            no_cols = 1
        else:
            # Insert at right edge of bounding box
            del_point = bbox[0][1]
            no_cols = self._get_no_rowscols(bbox)[1]

        with undo.group(_("Delete columns")):
            self.grid.actions.delete_cols(del_point, no_cols)

        self.grid.GetTable().ResetView()

        # Update the default sized cell sizes
        self.grid.actions.zoom()

        event.Skip()
830238
def _shift_rowcol(self, insertion_point, no_to_insert):
        """"""

        # Shift row heights

        new_row_heights = {}
        del_row_heights = []

        for row, tab in self.row_heights:
            if tab > insertion_point:
                new_row_heights[(row, tab + no_to_insert)] = \
                    self.row_heights[(row, tab)]
                del_row_heights.append((row, tab))

        for row, tab in new_row_heights:
            self.set_row_height(row, tab, new_row_heights[(row, tab)])

        for row, tab in del_row_heights:
            if (row, tab) not in new_row_heights:
                self.set_row_height(row, tab, None)

        # Shift column widths

        new_col_widths = {}
        del_col_widths = []

        for col, tab in self.col_widths:
            if tab > insertion_point:
                new_col_widths[(col, tab + no_to_insert)] = \
                    self.col_widths[(col, tab)]
                del_col_widths.append((col, tab))

        for col, tab in new_col_widths:
            self.set_col_width(col, tab, new_col_widths[(col, tab)])

        for col, tab in del_col_widths:
            if (col, tab) not in new_col_widths:
                self.set_col_width(col, tab, None)
756115
def clean_up(self):#, grid):
        
        if self.selected_col:
            col_label_value = self.grid.GetColLabelValue(self.selected_col)
            col_label_value = col_label_value.strip('\nEDIT ALL')
            self.grid.SetColLabelValue(self.selected_col, col_label_value)
            for row in range(self.grid.GetNumberRows()):
                self.grid.SetCellBackgroundColour(row, self.selected_col, 'white')
        self.grid.ForceRefresh()
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")
398127
function unflatten(valuesInOneDimension, size) {
  const {height, width} = size;
  const valuesInTwoDimensions = [];
  for (let y = 0; y < height; y++) {
    const start = y * width;
    const end = start + width;
    valuesInTwoDimensions.push(valuesInOneDimension.slice(start, end));
  }
  return valuesInTwoDimensions;
}
1205747
def delete_row(self, ind):
        
        self.df = pd.concat([self.df[:ind], self.df[ind+1:]], sort=True)
        return self.df
664826
public Matrix removeColumn(int j) {
        if (j >= columns || j < 0) {
            throw new IndexOutOfBoundsException("Illegal column number, must be 0.." + (columns - 1));
        }

        Matrix result = blankOfShape(rows, columns - 1);

        for (int jj = 0; jj < j; jj++) {
            result.setColumn(jj, getColumn(jj));
        }

        for (int jj = j + 1; jj < columns; jj++) {
            result.setColumn(jj - 1, getColumn(jj));
        }

        return result;
    }
818732
def removeComponent(self, row,col):
        
        self._segments[row].pop(col)

        # If this row is now empty we should remove it?
        if self.columnCountForRow(-1) == 0:
            self.removeRow(len(self._segments)-1)

        # in case of samplerate change, just always update
        self.updateCalibration()
1172599
def only_trashed(cls):
        
        instance = cls()

        column = instance.get_qualified_deleted_at_column()

        return instance.new_query_without_scope(SoftDeletingScope()).where_not_null(
            column
        )
1306159
def pop_empty_columns(self, empty=None):
        
        empty = ['', None] if empty is None else empty
        if len(self) == 0:
            return
        for col in list(self.columns):
            if self[0][col] in empty:
                if not [v for v in self.get_column(col) if v not in empty]:
                    self.pop_column(col)
444075
def resize_to_fit(cols, rows = nil)
      rows ||= cols
      change_geometry(Geometry.new(cols, rows)) do |ncols, nrows|
        resize(ncols, nrows)
      end
    end