Convert Dictionary To List Of Float-element
I want to convert this dictionary to a list of float elements. I have some code, but I don't know how to achieve this. The .csv file I have consists of both number and words. The n
Solution 1:
You're going to have to explain what your input currently looks like and what your desired output should look like.
If I understand the question, you want to create a list of floats from the values in the dictionary? If so, all you need to do is a simple list comprehension using the values of the dictionary.
float_elements = [float(val) for val indict.values()]
Post a Comment for "Convert Dictionary To List Of Float-element"