You can use list comprehension and explicitly check for a 2 or 5:
d['0'] = [int(val) if val in ('2', '5') else val for val in d['0']]
Here is an example:
In [12]: d
Out[12]: {'0': ['0', '1', '2', '3', '4', '5']}
In [13]: d['0'] = [int(val) if val in ('2', '5') else val for val in d['0']]
In [14]: d
Out[14]: {'0': ['0', '1', 2, '3', '4', 5]}
You can also use enumerate to check if the index is past a certain index you want to convert.
For example, convert the values after index 1 to an int:
In [17]: d
Out[17]: {'0': ['0', '1', '2', '3', '4', '5']}
In [18]: d['0'] = [int(val) if i > 1 else val for i, val in enumerate(d['0'])]
In [19]: d
Out[19]: {'0': ['0', '1', 2, 3, 4, 5]}