Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
How to check every pandas series value is unique

I know how to count the number of unique values in pandas series (one column in pandas dataframe).

pandas.Series.value_counts

But how do I check if they are all unique? Should I just compare value_counts with its length?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

IIUC, pd.Series.is_unique

pd.Series([1, 2, 3]).is_unique
True

And

pd.Series([1, 2, 2]).is_unique
False
over 4 years ago · Santiago Trujillo Report

0

You can use nunique

pd.Series([1, 2, 3]).nunique()==len(pd.Series([1, 2, 3]))
Out[62]: True
over 4 years ago · Santiago Trujillo Report

0

pd.Series([1,2,3,np.nan,np.nan]).is_unique

> False

It will give False for this which it should not.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!