Skip to main content

count (DataFrame)

Returns the number of rows in this DataFrame.

Syntax​

count()

Returns​

int: Number of rows.

Examples​

Python
df = spark.createDataFrame(
[(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"])

df.count()
# 3