1. Engineering
  2. Computer Science
  3. in python can someone help me turn my output below...

Question: in python can someone help me turn my output below...

Question details

In Python, can someone help me turn my output below in a nested dictionary or a possibly dataframe. I basically need to count the items in a list as well. For example

For 0: the number 4 has a count of 1 (4:1) and the number had a count of 1 (2:1)

For 1: 5:1, 2:1, 3:5

Thanks!

Note: It is fine if you don't have my input data. I just need the code and I can apply it to my data

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution