concept unique value in category pandas

appears as: unique values
Pandas in Action

This is an excerpt from Manning's book Pandas in Action.

A set is an unordered collection of unique values. As a reminder, the curly brace syntax for declaring a set is identical to that for declaring a dictionary. Python is able to distinguish between the two types based on the assignment of (or lack of assignment of) key-value pairs. pandas will raise a TypeError exception if we pass it into the Series constructor. There is no concept of order in a set. A dictionary is also unordered but there is a mapping between keys and values, which pandas can translate to a mapping of index labels to values. The library cannot do the same with a set[22].

Pandas includes a special data type called a category, which is ideal when a column includes a small number of unique values relative to its total size. Common examples of data points with a limited number of values include gender, weekdays, blood types, planets, income groups, and more. Behind the scenes, categorical values are stored as plain Python objects instead of NumPy ndarrays and are optimized for speed.

The nunique method can tell us the number of unique values in each column of a DataFrame. Note that missing values (NaN) will be excluded by default; you can add a dropna = False argument to the nunique method to include them in the count.