A

Admin • 802.91K Points
Coach

Q. How to get the number of unique values in a column?

  • (A) df['col'].count()
  • (B) df['col'].nunique()
  • (C) df['col'].unique()
  • (D) df['col'].distinct()
  • Correct Answer - Option(B)
  • Views: 3
  • Filed under category Pandas
  • Hashtags:

Explanation by: Admin
`nunique()` returns the count of unique values in a Series.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.