I have a dictionary in python e.g -
partitions = {'train': ['data/xyz/id-1', 'data/xyz/id-2', 'data/xyz/id-3',......],
'validation': ['data/pqr/id-4','data/pqr/id-5',.......]}
I want to replace 'data/xyz ' to 'samples/folder1' for all the values of the key 'train'.
the new values will be
samples/folder1/id-1, samples/folder1/id-2, samples/folder1/id-3 etc
similarly , 'data/pqr' to 'samples/test' for all the values of the key 'validation'.
I am unable to figure out how to do it in a concise way. Any help will be appreciated.