Counts the number of rows of the main dataframe
543058
def count(self):
        
        try:
            num = len(self.df.index)
        except Exception as e:
            self.err(e, "Can not count data")
            return
        self.ok("Found", num, "rows in the dataframe")
353480
def rowcount(self):
        
        if (self._closed or not self._result or "rows" not in self._result):
            return -1
        return self._result.get("rowcount", -1)
719371
def count(self):
        """"""
        cursor = self.conn.cursor()
        with contextlib.closing(cursor):
            cursor.execute('SELECT COUNT(*) FROM events')
            res = cursor.fetchone()
            return res[0]
1078317
def count(self, src):
        ''''''
        src = [self._full_hdfs_path(x) for x in src]
        return self._transform_count_output(self._getStdOutCmd([self._hadoop_cmd, 'fs', '-count'] + src, True), self.hdfs_url)
95988
def count(self):
        
        return functools.reduce(lambda x, y: x * y, (x.count for x in self.bounds))
148944
def count_row(engine, table):
    
    return engine.execute(select([func.count()]).select_from(table)).fetchone()[0]
841327
def tally(self, chain):
        """"""
        self.db._rows[chain][self.name] = self._getfunc()
1337427
def get_html_row_count(spans):
    """"""

    if spans == []:
        return 0
    row_counts = {}
    for span in spans:
        span = sorted(span)
        try:
            row_counts[str(span[0][1])] += get_span_row_count(span)
        except KeyError:
            row_counts[str(span[0][1])] = get_span_row_count(span)

    values = list(row_counts.values())
    return max(values)
754299
def count_rows(self, table_name):
        """"""
        self.table_must_exist(table_name)
        query = "SELECT COUNT (*) FROM `%s`" % table_name.lower()
        self.own_cursor.execute(query)
        return int(self.own_cursor.fetchone()[0])
297143
def count_matches(self):
        """"""

        try:
            self.fn = self.fo.name
            rows = self.file_rows(self.fo)
            self.fo.seek(0)

        except AttributeError:
            with open(self.fn) as fo:
                rows = self.file_rows(fo)

        matches_p = []
        matches_c = []
        for line in rows:
            cnt = len(re.findall(DATPRX, line))
            matches_p.append(cnt)
            cnt = len(re.findall(DATCRX, line))
            matches_c.append(cnt)

        self.rows = rows        # Is newlines in the end a problem?
        self.matches_p = matches_p
        self.matches_c = matches_c
293746
def objectcount(data, key):
    """"""
    objkey = key.upper()
    return len(data.dt[objkey])
308259
def tail(self, rows: int=5):
        
        if self.df is None:
            self.warning("Dataframe is empty: no tail available")
        return self.df.tail(rows)
354698
def _get_num_similar_rows(self, row, until=None):
        """"""
        return len(list(filter(lambda r: row == r, self.dataset[:until])))
422333
def skip_count(self):
        
        return len([i for i, result in enumerate(self.data) if result.skip])
1005034
def count(self):
        """"""
        if self._primary_keys is None:
            return self.queryset.count()
        else:
            return len(self.pks)
697534
def counts(args):
    
    p = OptionParser(counts.__doc__)
    opts, args = p.parse_args(args)

    if len(args) != 1:
        sys.exit(not p.print_help())

    vcffile, = args
    vcf_reader = vcf.Reader(open(vcffile))
    for r in vcf_reader:
        v = CPRA(r)
        if not v.is_valid:
            continue
        for sample in r.samples:
            ro = sample["RO"]
            ao = sample["AO"]
            print("\t".join(str(x) for x in (v, ro, ao)))
1232888
def sample(self, n):
    

    row_total_count = 0
    row_counts = []
    for file in self.files:
      with _util.open_local_or_gcs(file, 'r') as f:
        num_lines = sum(1 for line in f)
        row_total_count += num_lines
        row_counts.append(num_lines)

    names = None
    dtype = None
    if self._schema:
      _MAPPINGS = {
        'FLOAT': np.float64,
        'INTEGER': np.int64,
        'TIMESTAMP': np.datetime64,
        'BOOLEAN': np.bool,
      }
      names = [x['name'] for x in self._schema]
      dtype = {x['name']: _MAPPINGS.get(x['type'], object) for x in self._schema}

    skip_count = row_total_count - n
    # Get all skipped indexes. These will be distributed into each file.
    # Note that random.sample will raise Exception if skip_count is greater than rows count.
    skip_all = sorted(random.sample(range(0, row_total_count), skip_count))
    dfs = []
    for file, row_count in zip(self.files, row_counts):
      skip = [x for x in skip_all if x < row_count]
      skip_all = [x - row_count for x in skip_all if x >= row_count]
      with _util.open_local_or_gcs(file, 'r') as f:
        dfs.append(pd.read_csv(f, skiprows=skip, names=names, dtype=dtype, header=None))
    return pd.concat(dfs, axis=0, ignore_index=True)