A. To get unique values within each group, you can use the nunique method, which returns the number of unique values in each group.