my_list=[['A','B','C','0.0'],['D','E','F','1.2'],['G','H','I','0'],['J','K','L','M']]
I tried these but they can only convert whole numbers into floats and leaves the rest as strings.
[[float(x) if x.isnumeric() else x for x in i] for i in my_list]
for i, sublist in enumerate(my_list):
for j, x in enumerate(sublist):
if x.isnumeric():
my_list[i][j] = float(x)
Expected output
[['A','B','C',0.0],['D','E','F',1.2],['G','H','I',0],['J','K','L','M']]