nunique is slower than len(set(x.dropna())) for smaller Series. (original) (raw)

This is biting me when applying nunique on some groupby operations.

In one benchmark, which I'll shortly share, nunique() is slower until we get to a length of 3000.