Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2019 04:18 AM
To get the count of the distinct values:
df.select(F.countDistinct("colx")).show()
Or to count the number of records for each distinct value:
df.groupBy("colx").count().orderBy().show()