Solved by rahulvigneswaran in post #4 
              
              
                @ptrblck The following works for me. Thanks  
for i in range(10):
  idx = (dataset.targets==i)
  if (i == 0) or ((i % 2) == 0): dataset.targets[idx] = 0

  else: dataset.targets[idx] = 1