least_frequent

statistics

Finds the most common value (note naming is historical)

Syntax

least_frequent(array|dataframe)

Parameters

array|dataframe (array or dataframe)

The data to find the most common value in

Returns

any

The most common value in the data

Examples

Most common category from products
Input:
.category | least_frequent
Output:
electronics
Most common status from orders
Input:
map(.status) | least_frequent
Output:
completed

The least_frequent() function finds the most common (mode) value in the data. Note: Despite its name (historical), this function returns the most frequent value, not the least frequent.

Usage

Use least_frequent() for finding the mode of your data, identifying the most common category or value.

Related Functions