coverting list of string coordinates into list of lists coordinates without string

Question:

I have a list of list of strings, but each string a coordinate separated by commas, I want to convert into list of lists of coordinates without string

my_list =['44324,-34244', '44885.1,-33445.6', '45373.1,-32849.8', '45380.1,-32625.6', '44635.7,-32285.6', '44635.7,-32285.6']

I want to convert into

[[44324,-34244], [44885.1,-33445.6], [45373.1,-32849.8], [45380.1,-32625.6], [44635.7,-32285.6], [44635.7,-32285.6]]```

I tried the following but it doesn't work


```coords = [map(float,i.split(",")) for i in my_list]```

print(coords) gives me gives me <map object at 0x7f7a7715d2b0>

Asked By: user110920

||

Answers:

Wrap map(...) in list(...) like so:

coords = [list(map(float,i.split(","))) for i in my_list]
Answered By: Nazar Nintendo
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.