To get rid of all duplicates from your database, you must ask yourself a question first - what to do with them? Remove? Merge somehow? Change name of each duplicate?
After answering that question, simply construct data migration (with RunPython migration) that will do desired operation on each duplicated entry.
To find all duplicates, you can do:
from django.db.models import Count
with_duplicates = Doctor.objects.annotate(count=Count('id')).order_by('id').distinct('name').filter(count__gt=1)
That query will fetch from database first (by id) record from duplicates group (for example if you have 3 doctors named "who", it will fetch first of them and it will fetch only doctors with duplicates).
Having that, for each doctor that have duplicates, you can get list of that duplicates:
with_duplicates = Doctor.objects.annotate(count=Count('id')).order_by('id').distinct('name').filter(count__gt=1)
for doctor in with_duplicates:
duplicates = Doctor.objects.filter(name=doctor.name).exclude(id=doctor.id)
And do something with them.