Skip to content

DataStream.min

Return the minimum values of the specified columns.

Parameters:

Name Type Description Default
columns str or list

the column name or a list of column names.

required
collect bool

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

True
Source code in pyquokka/datastream.py
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
def min(self, columns, collect = True):

    """
    Return the minimum values of the specified columns.

    Args:
        columns (str or list): the column name or a list of column names.
        collect (bool): if True, return a Polars DataFrame. If False, return a Quokka DataStream.
    """

    assert type(columns) == str or type(columns) == list
    if type(columns) == str:
        columns = [columns]
    for col in columns:
        assert col in self.schema
    if collect:
        return self.agg({col: "min" for col in columns}).collect()
    else:
        return self.agg({col: "min" for col in columns})