class_docstr: A set of methods for aggregations on a :class:`DataFrame`,
  created by :func:`DataFrame.groupBy`.
  
  .. versionadded:: 1.3.0
  
  .. versionchanged:: 3.4.0
      Supports Spark Connect.
class_docstr_tok: ["A","set","of","methods","for","aggregations","on","a",":","class",":","`","DataFrame","`",",","created","by",":","func",":","`","DataFrame.groupBy","`",".","..","versionadded",":",":","1.3.0","..","versionchanged",":",":","3.4.0","Supports","Spark","Connect","."]
docstr: Counts the number of records for each group.
  
  .. versionadded:: 1.3.0
  
  .. versionchanged:: 3.4.0
      Supports Spark Connect.
  
  Examples
  --------
  >>> df = spark.createDataFrame(
  ...      [(2, "Alice"), (3, "Alice"), (5, "Bob"), (10, "Bob")], ["age", "name"])
  >>> df.show()
  +---+-----+
  |age| name|
  +---+-----+
  |  2|Alice|
  |  3|Alice|
  |  5|  Bob|
  | 10|  Bob|
  +---+-----+
  
  Group-by name, and count each group.
  
  >>> df.groupBy(df.name).count().sort("name").show()
  +-----+-----+
  | name|count|
  +-----+-----+
  |Alice|    2|
  |  Bob|    2|
  +-----+-----+
docstr_tok: ["Counts","the","number","of","records","for","each","group",".","..","versionadded",":",":","1.3.0","..","versionchanged",":",":","3.4.0","Supports","Spark","Connect",".","Examples","--","--","--","--",">",">",">","df","=","spark.createDataFrame","(","...","[","(","2",",","``","Alice","''",")",",","(","3",",","``","Alice","''",")",",","(","5",",","``","Bob","''",")",",","(","10",",","``","Bob","''",")","]",",","[","``","age","''",",","``","name","''","]",")",">",">",">","df.show","(",")","+","--","-+","--","--","-+","|age|","name|","+","--","-+","--","--","-+","|","2|Alice|","|","3|Alice|","|","5|","Bob|","|","10|","Bob|","+","--","-+","--","--","-+","Group-by","name",",","and","count","each","group",".",">",">",">","df.groupBy","(","df.name",")",".count","(",")",".sort","(","``","name","''",")",".show","(",")","+","--","--","-+","--","--","-+","|","name|count|","+","--","--","-+","--","--","-+","|Alice|","2|","|","Bob|","2|","+","--","--","-+","--","--","-+"]
code: def count(self) -> DataFrame:
      """Counts the number of records for each group.
  
      .. versionadded:: 1.3.0
  
      .. versionchanged:: 3.4.0
          Supports Spark Connect.
  
      Examples
      --------
      >>> df = spark.createDataFrame(
      ...      [(2, "Alice"), (3, "Alice"), (5, "Bob"), (10, "Bob")], ["age", "name"])
      >>> df.show()
      +---+-----+
      |age| name|
      +---+-----+
      |  2|Alice|
      |  3|Alice|
      |  5|  Bob|
      | 10|  Bob|
      +---+-----+
  
      Group-by name, and count each group.
  
      >>> df.groupBy(df.name).count().sort("name").show()
      +-----+-----+
      | name|count|
      +-----+-----+
      |Alice|    2|
      |  Bob|    2|
      +-----+-----+
      """
  
imports: import sys
  from typing import Callable, List, Optional, TYPE_CHECKING, overload, Dict, Union, cast, Tuple
  from py4j.java_gateway import JavaObject
  from pyspark.sql.column import Column, _to_seq
  from pyspark.sql.session import SparkSession
  from pyspark.sql.dataframe import DataFrame
  from pyspark.sql.pandas.group_ops import PandasGroupedOpsMixin
label_desc: Use image node_id 6 for calling the GroupedData obj's underlying member method code with example usage: obj.count() without return types