A

Admin • 833.24K Points
Coach

Q. Which method checks if a DataFrame column has only unique values?

  • (A) df['col'].unique().all()
  • (B) df['col'].is_unique
  • (C) df['col'].nunique() == len(df)
  • (D) df['col'].distinct()
  • Correct Answer - Option(B)
  • Views: 26
  • Filed under category Pandas
  • Hashtags:

Explanation by: Admin

`is_unique` checks if all values in a Series are unique.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.