I'm trying to convert the strings in this list of lists into decimal form:
ask = [['31188.28758860', 2], ['31183.48445986', 0.14258435], ...]
I tried using elem.strip('"') for elem in ask to remove the quote marks but get "AttributeError: 'list' object has no attribute 'strip'" So I assume I am not accessing the nested level of the strings
elem.strip('"') for elem in ask
[float(elem[0]) for elem in ask]
to just get the first values of your nested list.
OR
[[float(elem[0]), elem[1]] for elem in ask]
to get the same structure than before, but with the strings replaced by floats.
1.4m articles
1.4m replys
5 comments
57.0k users