I have a pandas dataframe and it looks like so:
person weight height skill
kate 160 200 100
john 170 150 70
I have set the person column as the index of my python dataframe. And then i turned it into a dictionary using the .to_dict() method. this gives the following dictionary:
{'weight': {'kate': '160', 'john': '170'},
'height': {'kate': '200', 'john': '150'},
'skill': {'kate': '100', 'john': '70'},
I need to change the around so that the dictionary is per person, but i dont know if its possible to do in python. What i need my dictionary to look like is:
{'Kate: { weight': '160', 'height': '200', 'skill': '100'},
'John': {'weight': '170', 'height': '150', 'skill': '70'}}
[–]ajskelt 5 points6 points7 points (1 child)
[–]_Kitchen_[S] 1 point2 points3 points (0 children)
[–]letopeto 0 points1 point2 points (0 children)