I got a large dataframe like that, which basically looks like this:
Name | km | Min | Max |
---|---|---|---|
test | 24.6 | 43 | 555 |
test | 63.9 | 31 | 666 |
which I would like to turn into a dictionary like:
{24.6: ["test",43,555],
63.9: ["test",31,666]}
What I found so far was https://stackoverflow.com/a/67496211/9218349, which would result in:
dict(zip(zip(df.km),zip(df.Name, df.Min,df.Max)))
this way i receive a dictionary of tuples, but I wont the keys to be floats and the values to be strings and floats. The floats should generally have 2 decimal places.
How would I do that?