pandas datafram count of each unique value in a column of sentences grouped by code example
Example 1: pandas count the number of unique values in a column
df['hID'].nunique()
5
Example 2: pandas count unique values in column
df.nunique()
Example 3: pandas groupby count unique rows
ID, domain
123, 'vk.com'
123, 'vk.com'
123, 'twitter.com'
456, 'vk.com'
456, 'facebook.com'
456, 'vk.com'
456, 'google.com'
789, 'twitter.com'
789, 'vk.com'