Skip to main content
Ctrl+K
PyFlink 1.20+vvr.11.7.dev0 documentation - Home PyFlink 1.20+vvr.11.7.dev0 documentation - Home
  • API Reference
  • Examples
  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataStream
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • DataType
    • User Defined Functions
    • Configuration
    • GPU Support
    • AI / LLM
  • PyFlink Common
  • API Reference
  • PyFlink DataFrame
  • DataFrame
  • pyflink.dataframe.dataframe.DataFrame.group_by

pyflink.dataframe.dataframe.DataFrame.group_by#

DataFrame.group_by(*columns: str | Expression) → 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.DataFrame.rename_columns

next

pyflink.dataframe.dataframe.DataFrame.agg

On this page
  • DataFrame.group_by()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.