# nunique()

*noun*

say it: **“EN yoo-NEEK”** **/ˈɛn juˈnik/**

A pandas method that counts how many different values appear in a column.

## What does **nunique()** do in pandas?

**nunique()**, read "n unique", counts how many different values a column holds, leaving missing values out. Where
`unique()` lists them, `nunique()` gives only how many.

```python
import pandas as pd
sales = pd.read_csv("sales.csv")
print("vendors:", sales["vendor_id"].nunique())    # vendors: 15
```

## In a sentence

- “**nunique()** said 15 different vendors sold at the market.”
- “The shelter log had 800 rows, but **nunique()** found only 750 animal IDs.”

Level: Apprentice · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=2)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/nunique
