for each row we store values and indices
190025
function () {
      var rowCounts = new Uint32Array(nrows);
      var columnCounts = new Uint32Array(ncols);
      for (var i = 0; i < nrows; i++) {
        var obj = matrix[i];
        if (obj.values != null) {
          // trim to size
          var values = new Uint16Array(obj.length);
          var indices = new Uint32Array(obj.length);
          values.set(obj.values.slice(0, obj.length));
          indices.set(obj.indices.slice(0, obj.length));
          matrix[i] = {values: values, indices: indices};
          rowCounts[i] = values.length;
          for (var j = 0; j < obj.length; j++) {
            columnCounts[indices[j]] += 1;
          }
        }
      }
      dataset = new morpheus.Dataset({
        rows: nrows, columns: ncols, name: morpheus.Util.getBaseFileName(morpheus.Util
          .getFileName(fileOrUrl)), array: matrix, dataType: dataType, defaultValue: 0
      });

      dataset.getRowMetadata().add('count>0').array = rowCounts;
      dataset.getColumnMetadata().add('count>0').array = columnCounts;
    }
748677
function(data){
			var rows = this.calculateRowsNumber();
			var datas = [];
			for(var i = 0; i < data.length; i += rows){
				datas.push(data.slice(i, i+rows));
			}
			return datas;
		}
781449
def store_index   #:nodoc:
    return unless compatibility?

    indices     = @db_indices
    reserved    = 0x00000000
    row_min     = @dimension.row_min
    row_max     = @dimension.row_max

    record      = 0x020B                 # Record identifier
    length      = 16 + 4 * indices.size  # Bytes to follow

    header      = [record, length].pack('vv')
    data        = [reserved, row_min, row_max, reserved].pack('VVVV')

    indices.each do |index|
      data += [index + @offset + 20 + length + 4].pack('V')
    end

    prepend(header, data)
  end
157196
def _display_data(self, index):
        """"""
        return to_qvariant(self._data[index.row()][index.column()])
880164
def store(self, record, value):
        """"""
        record._values[self.name][record.id] = value
246385
def _index_list_of_values(d, k):
    """"""
    v = d[k]
    if isinstance(v, list):
        return v
    return [v]
109684
function(table) {
        var data = [];
        var rows = table.rows;
        var index = 0;
        var length = rows.length;
        var columnIndex, colspanRange, rowspanRange;

        // Step 1: Init the data matrix
        for (; index < length; index += 1) {
            data[index] = [];
        }

        // Step 2: Traverse the table
        _.each(rows, function(tr, rowIndex) {
            columnIndex = 0;

            _.each(tr.cells, function(td) {
                var text = td.textContent || td.innerText;

                while (data[rowIndex][columnIndex]) {
                    columnIndex += 1;
                }

                colspanRange = [columnIndex, columnIndex + (td.colSpan || 1)];
                rowspanRange = [rowIndex, rowIndex + (td.rowSpan || 1)];

                // Step 3: Set the value of td element to the data matrix as colspan and rowspan ranges
                setDataInSpanRange(text, data, colspanRange, rowspanRange);

                columnIndex = colspanRange[1];
            });
        });

        return data;
    }
969810
function () {
      for (var r = 0; r < self.rowCount; r++) {
        for (var c = 0; c < self.colCount; c++) {
          datamap.set(r, datamap.colToProp(c), '');
        }
      }
    }
413479
public void getRow(int i, double[] array, int offset)
    {
        int n = cols;
        for (int j=0;j<n;j++)
        {
            array[j+offset] = get(i, j);
        }
    }
1139831
def setValues(self, rows, *values):
        ''
        for r, v in zip(rows, itertools.cycle(values)):
            self.setValueSafe(r, v)
        self.recalc()
        return status('set %d cells to %d values' % (len(rows), len(values)))
667989
def rows(self):
        
        rows = []
        for rowName in self.rowNames:
            row = {columnName: self[rowName, columnName] for columnName in self.columnNames}
            row["_"] = rowName
            rows.append(row)
        return rows
168113
@Override
  public void aggregate()
  {
    final IndexedInts keys = keySelector.getRow();
    for (int i = 0; i < valueSelectors.length; i++) {
      values[i] = valueSelectors[i].getDouble();
    }
    synchronized (this) {
      for (int i = 0, keysSize = keys.size(); i < keysSize; i++) {
        final String key = keySelector.lookupName(keys.get(i));
        sketch.update(key, values);
      }
    }
  }
624760
def select_data(self, iteration_indices):
        """"""
        dat = self
        iteridx = iteration_indices
        dat.f = dat.f[np.where([x in iteridx for x in dat.f[:, 0]])[0], :]
        dat.D = dat.D[np.where([x in iteridx for x in dat.D[:, 0]])[0], :]
        try:
            iteridx = list(iteridx)
            iteridx.append(iteridx[-1])  # last entry is artificial
        except:
            pass
        dat.std = dat.std[np.where([x in iteridx
                                    for x in dat.std[:, 0]])[0], :]
        dat.xmean = dat.xmean[np.where([x in iteridx
                                        for x in dat.xmean[:, 0]])[0], :]
        try:
            dat.xrecent = dat.x[np.where([x in iteridx for x in
                                          dat.xrecent[:, 0]])[0], :]
        except AttributeError:
            pass
        try:
            dat.corrspec = dat.x[np.where([x in iteridx for x in
                                           dat.corrspec[:, 0]])[0], :]
        except AttributeError:
            pass
505496
def _create_row_col_indices(ratings_df):
  """"""
  user_id_to_user_idx = _create_index(ratings_df, "userId")
  item_id_to_item_idx = _create_index(ratings_df, "movieId")

  ratings_df["row"] = ratings_df["userId"].apply(
      lambda x: user_id_to_user_idx[x])
  ratings_df["col"] = ratings_df["movieId"].apply(
      lambda x: item_id_to_item_idx[x])

  return ratings_df
1331242
def rowsWithin(self, bbox):
        ''
        ret = {}
        for y in range(bbox.ymin, bbox.ymax+1):
            for x in range(bbox.xmin, bbox.xmax+1):
                for attr, rows in self.pixels[y][x].items():
                    if attr not in self.hiddenAttrs:
                        for r in rows:
                            ret[id(r)] = r
        return list(ret.values())
1351974
function ()
	{
		$.each( this.s.dt.aoColumns, function (i, column) {
			$(column.nTh).attr('data-column-index', i);
		} );
	}
1034313
def column(index)
      index = parse_index(index)
      columns = []
      @data.each do |row|
        columns << row_to_array(row)[index].value
      end
      columns
    end