---
title: count (DataFrame)
description: "DataFrame.count method in PySpark: Returns the number of rows in this DataFrame."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/dataframe/count
---

# 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
```
