how to count number of occurrences of value in pandas include NaN code example Example: relativefrequencies of the unique values pandas df.value_counts(normalize=True)