Takes a subset of rows
514442
def take(self, idxs):
        
        import utool as ut
        if False:
            key_to_list = ut.odict([
                (key, ut.take(val, idxs))
                for key, val in six.iteritems(self._key_to_list)
            ])
        else:
            import numpy as np
            key_to_list = ut.odict([
                (key, ut.take(val, idxs))
                if not isinstance(val, np.ndarray)
                else val.take(idxs, axis=0)
                for key, val in six.iteritems(self._key_to_list)
            ])
        newself = self.__class__(key_to_list, self._meta.copy())
        return newself
1284187
def dropna_rows(data: pd.DataFrame, columns_name: str=None):
    
    params = {}
    if columns_name is not None:
        params.update({'subset': columns_name.split(',')})
    data.dropna(inplace=True, **params)
1241062
def _parse_row(row, sep=','):
    '''

    '''
    parsed = row.split(sep)
    parsed = [x for x in parsed if x.strip()]
    return parsed
129912
def _build_simple_row(padded_cells, rowfmt):
    ""
    begin, sep, end = rowfmt
    return (begin + sep.join(padded_cells) + end).rstrip()
144487
def from_row(row):
    ''''''
    subject = (row[5][0].upper() + row[5][1:]) if row[5] else row[5]
    return Advice.objects.create(
        id=row[0],
        administration=cleanup(row[1]),
        type=row[2],
        session=datetime.strptime(row[4], '%d/%m/%Y'),
        subject=cleanup(subject),
        topics=[t.title() for t in cleanup(row[6]).split(', ')],
        tags=[tag.strip() for tag in row[7].split(',') if tag.strip()],
        meanings=cleanup(row[8]).replace(' / ', '/').split(', '),
        part=_part(row[9]),
        content=cleanup(row[10]),
    )
549333
private SparseDoubleVector updateRow(int row) {
        SparseDoubleVector rowVec = rowToColumns.get(row);
        if (rowVec == null) {
            rowVec = emptyVector.instanceCopy();
            rowToColumns.put(row, rowVec);
        }

        return rowVec;
    }
914796
def _prepend_row_index(rows, index):
    """"""
    if index is None or index is False:
        return rows
    if len(index) != len(rows):
        print('index=', index)
        print('rows=', rows)
        raise ValueError('index must be as long as the number of data rows')
    rows = [[v] + list(row) for v, row in zip(index, rows)]
    return rows
749022
def drop_empty(rows):
    
    return zip(*[col for col in zip(*rows) if bool(filter(bool, col[1:]))])
1227424
def extract_row(self,  row):
        
        new_row = []
        for col in range(self.get_grid_width()):
            new_row.append(self.get_tile(row, col))    
        return new_row
1096956
def selectedRows(self):
        ''
        if len(self._selectedRows) <= 1:
            return list(self._selectedRows.values())
        return [r for r in self.rows if id(r) in self._selectedRows]
31501
private void accum_subset(Chunk chks[], Chunk wrks, Chunk weight, int nnids[]) {
    for( int row=0; row<nnids.length; row++ ) { // Over all rows
      int nid = nnids[row];                     // Get Node to decide from
      if( nid >= 0 ) {        // row already predicts perfectly or OOB
        double w = weight.atd(row);
        if (w == 0) continue;
        double resp = wrks.atd(row);
        assert !Double.isNaN(wrks.atd(row)); // Already marked as sampled-away
        DHistogram nhs[] = _hcs[nid];
        int sCols[] = _tree.undecided(nid+_leaf)._scoreCols; // Columns to score (null, or a list of selected cols)
        if (sCols == null) {
          for(int col=0; col<nhs.length; ++col ) { //all columns
            if (nhs[col]!=null)
              nhs[col].incr(chks[col].atd(row), resp, w); // Histogram row/col
          }
        } else {
          for( int col : sCols )
            nhs[col].incr(chks[col].atd(row), resp, w); // Histogram row/col
        }
      }
    }
  }
438886
def fill_row(self, forward, items, idx, row, ro, ri, overlap,lengths):
        ""
        ibuf = n = 0
        ro  -= 1
        while ibuf < row.size:
            ro   += 1
            ix    = idx[ro]
            rag   = items[ix]
            if forward:
                ri = 0 if ibuf else ri
                n  = min(lengths[ix] - ri, row.size - ibuf)
                row[ibuf:ibuf+n] = rag[ri:ri+n]
            else:
                ri = lengths[ix] if ibuf else ri
                n  = min(ri, row.size - ibuf)
                row[ibuf:ibuf+n] = rag[ri-n:ri][::-1]
            ibuf += n
        return ro, ri + ((n-overlap) if forward else -(n-overlap))
1322296
def gatherBy(self, func):
        ''
        for i in rotate_range(len(self.rows), self.cursorRowIndex):
            try:
                r = self.rows[i]
                if func(r):
                    yield r
            except Exception:
                pass
21327
def collect_rows &block
      return to_enum(:collect_rows) unless block_given?

      Daru::Vector.new(each_row.map(&block), index: @index)
    end
1011339
@SafeVarargs
  public final TypedDataSet<T> rows(T... rows)  {
    for (T rowObj : rows) {
      super.row(conv.convert(rowObj));
    }
    return this;
  }
290252
function getRows (elements, row) {
  if (!row) {
    return [ elements ]
  }

  let lastOffset = false

  return elements.reduce((rows, el) => {

    if (lastOffset !== el.offsetTop) {
      rows.push([el])
    } else {
      rows[rows.length - 1].push(el)
    }

    lastOffset = el.offsetTop

    return rows

  }, [])
}
1285162
def columnise(rows, padding=2):
    """"""
    strs = []
    maxwidths = {}

    for row in rows:
        for i, e in enumerate(row):
            se = str(e)
            nse = len(se)
            w = maxwidths.get(i, -1)
            if nse > w:
                maxwidths[i] = nse

    for row in rows:
        s = ''
        for i, e in enumerate(row):
            se = str(e)
            if i < len(row) - 1:
                n = maxwidths[i] + padding - len(se)
                se += ' ' * n
            s += se
        strs.append(s)
    return strs