Skip to content

DataStream.count

Return total row count.

Parameters:

Name Type Description Default
collect bool

if True, return a Polars DataFrame. If False, return a Quokka DataStream.

True
Source code in pyquokka/datastream.py
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
def count(self, collect = True):

    """
    Return total row count.

    Args:
        collect (bool): if True, return a Polars DataFrame. If False, return a Quokka DataStream.
    """
    if collect:
        return self.agg({"*":"count"}).collect()
    else:
        return self.agg({"*":"count"})