I'm trying to convert numbers within an array to letters. So '001' would be changed to 'A', '002' to 'B', all the way to '025' to 'Y'.
So far I've tried using a dictionary to replace the values but that doesn't seem to work, using np.place doesn't work since it's an if/else condition and I have more variables than that.
Polymer_data = Polymer_data.sort_values(['ID'])
for i in Polymer_data.ID:
first_arr = np.array(i.split('-'))
print(first_arr)
A small sample of the data in the array
['001' '001' '001' '021']
['001' '001' '001' '022']
['006' '009' '019' '016']
['006' '009' '019' '017']
['019' '025' '001' '025']
['019' '025' '002' '022']
['025' '013' '025' '025']
['025' '014' '017' '025']
['025' '014' '020' '025']
['025' '015' '022' '025']
['025' '015' '025' '025']
['025' '017' '017' '025']
['025' '017' '017' '025']
So the data above should be converted to
['A' 'A' 'A' 'U']
['A' 'A' 'A' 'V']
['F' 'I' 'S' 'P']
['F' 'I' 'S' 'Q']
['S' 'Y' 'A' 'Y']
['S' 'Y' 'B' 'V']
['Y' 'M' 'Y' 'Y']
['Y' 'N' 'Q' 'Y']
['Y' 'N' 'T' 'Y']
['Y' 'O' 'V' 'Y']
['Y' 'O' 'Y' 'Y']
['Y' 'Q' 'Q' 'Y']
['Y' 'Q' 'Q' 'Y']
Edit: Formatting on the code
Also in terms of the array structure '001' to '025' is arranged in a sequence of four which is repeated until all permutations are accounted for, so the full list of array has over 180000 rows.
forloop appears to be empty. Remember that statements in aforloop have to be indented in Python.