---
title: "counts(order:)"
framework: tabulardata
role: symbol
role_heading: Instance Method
path: "tabulardata/rowgrouping/counts(order:)"
---

# counts(order:)

Generates a data frame with two columns, one that has a row for each group key and another for the number of rows in the group.

## Declaration

```swift
func counts(order: Order? = nil) -> DataFrame
```

## Parameters

- `order`: A sorting order the method uses to sort the data frame by its count column.

## Discussion

Discussion The name of the data frame’s column that stores the number of rows in each group is count.

## See Also

### Aggregating a Row Grouping

- [aggregated(on:naming:transform:)](tabulardata/rowgrouping/aggregated(on:naming:transform:).md)
