Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • Data Types
    • User Defined Functions
    • Configuration
    • Catalog
    • GPU Support
    • AI / LLM
  • PyFlink Multimodal
  • PyFlink DataStream
  • PyFlink Common

pyflink.dataframe.DataFrame.group_by#

DataFrame.group_by(*columns: Union[str, pyflink.table.expression.Expression]) → pyflink.dataframe.dataframe.GroupedDataFrame[source]#

Group the DataFrame by columns.

Parameters

*columns – Columns to group by.

Returns

A GroupedDataFrame for aggregation operations.

Example::
>>> import pyflink.dataframe as pf
>>> df = pf.from_records(
...     [("A", 1), ("A", 2), ("B", 3)],
...     schema=["category", "value"],
... )
>>> result = df.group_by("category").agg(
...     pf.col("category"),
...     pf.col("value").sum.alias("total")
... )

previous

pyflink.dataframe.DataFrame.fill_nan

next

pyflink.dataframe.DataFrame.agg

Show Source

Created using Sphinx 4.5.0.