converts the columns of A to ranks
329808
def toRanks(A):
    
    AA=sp.zeros_like(A)
    for i in range(A.shape[1]):
        AA[:,i] = st.rankdata(A[:,i])
    AA=sp.array(sp.around(AA),dtype="int")-1
    return AA
1191323
function (columns) {
        var i, j, k,
            totalCol = 0,
            flag = [];

        for (i = 0; i < columns[0].length; i++) {
            totalCol += columns[0][i].colspan || 1;
        }

        for (i = 0; i < columns.length; i++) {
            flag[i] = [];
            for (j = 0; j < totalCol; j++) {
                flag[i][j] = false;
            }
        }

        for (i = 0; i < columns.length; i++) {
            for (j = 0; j < columns[i].length; j++) {
                var r = columns[i][j],
                    rowspan = r.rowspan || 1,
                    colspan = r.colspan || 1,
                    index = $.inArray(false, flag[i]);

                if (colspan === 1) {
                    r.fieldIndex = index;
                    // when field is undefined, use index instead
                    if (typeof r.field === 'undefined') {
                        r.field = index;
                    }
                }

                for (k = 0; k < rowspan; k++) {
                    flag[i + k][index] = true;
                }
                for (k = 0; k < colspan; k++) {
                    flag[i][index + k] = true;
                }
            }
        }
    }
4242
def column_vectors(self):
        """"""
        a, b, c, d, e, f, _, _, _ = self
        return (a, d), (b, e), (c, f)
439433
private int viewIndexForColumn(TableColumn aColumn) {
        TableColumnModel cm = table.getColumnModel();

        for (int column = 0; column < cm.getColumnCount(); column++) {
            if (cm.getColumn(column) == aColumn) {
                return column;
            }
        }

        return -1;
    }
47899
def _values_for_rank(self):
        
        from pandas import Series
        if self.ordered:
            values = self.codes
            mask = values == -1
            if mask.any():
                values = values.astype('float64')
                values[mask] = np.nan
        elif self.categories.is_numeric():
            values = np.array(self)
        else:
            #  reorder the categories (so rank can use the float codes)
            #  instead of passing an object array to rank
            values = np.array(
                self.rename_categories(Series(self.categories).rank().values)
            )
        return values
538167
public function sortColumnsByOrder()
    {
        $columns = $this->_columns;
        foreach ($this->getColumnsOrder() as $columnId => $after) {
            if ($after[0] === '-') {
                $before = substr($after, 1);
                $after = null;
            } else {
                $before = null;
            }
            if ($after !== null && isset($columns[$after])) {
                $currentPosition = array_search($columnId, array_keys($columns));
                $value = array_splice($columns, $currentPosition, 1);

                $destPosition = array_search($after, array_keys($columns)) + 1;
                $columns = array_slice($columns, 0, $destPosition) + $value + array_slice($columns, $destPosition);
            } elseif ($before !== null && $columns[$before]) {
                $currentPosition = array_search($columnId, array_keys($columns));
                $value = array_splice($columns, $currentPosition, 1);

                $destPosition = array_search($before, array_keys($columns));
                $columns = array_slice($columns, 0, $destPosition) + $value + array_slice($columns, $destPosition);
            }
        }

        $this->_columns = $columns;

        end($this->_columns);
        $this->_lastColumnId = key($this->_columns);
        return $this;
    }
384036
def PyobjColumns(obj):
    ''
    return [ColumnAttr(k, type(getattr(obj, k))) for k in getPublicAttrs(obj)]
852039
def calculate_columns(self):
        """"""

        self.cols = int(math.ceil(len(self.elements) / float(self.rows)))
862201
def sortByColumn(self, index):
        """"""
        if self.sort_old == [None]:
            self.header_class.setSortIndicatorShown(True)
        sort_order = self.header_class.sortIndicatorOrder()
        self.sig_sort_by_column.emit()
        if not self.model().sort(index, sort_order):
            if len(self.sort_old) != 2:
                self.header_class.setSortIndicatorShown(False)
            else:
                self.header_class.setSortIndicator(self.sort_old[0],
                                                   self.sort_old[1])
            return
        self.sort_old = [index, self.header_class.sortIndicatorOrder()]
179574
def rankdata(inlist):
    
    n = len(inlist)
    svec, ivec = shellsort(inlist)
    sumranks = 0
    dupcount = 0
    newlist = [0] * n
    for i in range(n):
        sumranks = sumranks + i
        dupcount = dupcount + 1
        if i == n - 1 or svec[i] != svec[i + 1]:
            averank = sumranks / float(dupcount) + 1
            for j in range(i - dupcount + 1, i + 1):
                newlist[ivec[j]] = averank
            sumranks = 0
            dupcount = 0
    return newlist
576560
def _sort_cols(self, cols, kwargs):
        
        if not cols:
            raise ValueError("should sort by at least one column")
        if len(cols) == 1 and isinstance(cols[0], list):
            cols = cols[0]
        jcols = [_to_java_column(c) for c in cols]
        ascending = kwargs.get('ascending', True)
        if isinstance(ascending, (bool, int)):
            if not ascending:
                jcols = [jc.desc() for jc in jcols]
        elif isinstance(ascending, list):
            jcols = [jc if asc else jc.desc()
                     for asc, jc in zip(ascending, jcols)]
        else:
            raise TypeError("ascending can only be boolean or list, but got %s" % type(ascending))
        return self._jseq(jcols)
527163
def rank(items, sequence=string.ascii_lowercase):
    
    items = set(items)
    return sum(1 << i for i, s in enumerate(sequence) if s in items)
223847
static
	private <E> List<E> toJavaList(List<E> values, int rows, int columns){
		List<E> result = new ArrayList<>(values.size());

		for(int i = 0; i < values.size(); i++){
			int row = i / columns;
			int column = i % columns;

			E value = values.get((column * rows) + row);

			result.add(value);
		}

		return result;
	}
775897
def comparable(self):
    """"""
    string_parts = []

    string_parts.append('table name: {0:s}'.format(self.table_name))
    string_parts.append('column name: {0:s}'.format(self.column_name))

    if self.row_condition is not None:
      row_condition_string = ' '.join([
          '{0!s}'.format(value) for value in self.row_condition])
      string_parts.append('row condition: "{0:s}"'.format(
          row_condition_string))

    if self.row_index is not None:
      string_parts.append('row index: {0:d}'.format(self.row_index))

    return self._GetComparable(sub_comparable_string=', '.join(string_parts))
1118983
private static Sort getSort(String... columnNames) {
        Sort key = null;
        for (String s : columnNames) {
            if (key == null) {
                key = first(s, Sort.Order.DESCEND);
            } else {
                key.next(s, Sort.Order.DESCEND);
            }
        }
        return key;
    }
484143
function sortedColumnClasses(classes) {
        // extract column classes
        var colClasses = [];
        while (true) {
            var match = COL_REGEX.exec(classes);
            if (!match) {
                break;
            }
            var colClass = match[0];
            colClasses.push(colClass);
            classes = withoutClass(classes, colClass);
        }

        colClasses.sort(compareColumnClasses);
        return classes + ' ' + colClasses.join(' ');
    }
259553
protected void convertToColumnMajor(DMatrixRMaj A) {
        for( int x = 0; x < numCols; x++ ) {
            double colQ[] = dataQR[x];
            for( int y = 0; y < numRows; y++ ) {
                colQ[y] = A.data[y*A.numCols+x];
            }
        }
    }