import pydicom ds = pydicom.dcmread('study.dcm') ds.PatientName = 'ANONYMIZED' del ds.PatientBirthDate