I have a csv to read from as follows
A B C
Sam 123 PID-213
Sam 145 PID-432
Sam 123 PID-546
Dan 786 PID-321
Dan 897 PID-432
and I want a group as below: count of unique B elements and Pids. (Bis 2 because 123 is repeated twice so)
A B C
Sam 2 3
Dan 2 2
And from the above plot a graph as below : and also a pie chart from column A and B and save it in a pdf in 2 different page.

How do i achieve this