I have an List like down below
[['-6.167665', '106.904251'], ['-6.167665', '106.904251']]
How to make it like this?
[[-6.167665, 106.904251], [-6.167665, 106.904251]]
Any suggestions how to do it?
Other answers already have suggested the method of doing it, which is convert to float. The most efficient way to do it is map:
values = [['-6.167665', '106.904251'], ['-6.167665', '106.904251']]
float_values = [list(map(float, vals)) for vals in values]
print(float_values)
Gives you:
[[-6.167665, 106.904251], [-6.167665, 106.904251]]
df.astype(float).to_numpy().tolist()