I have a nested dictionary of people and item ratings, with people as the key. people may or may not share items. Example:
{ \'Bob\' : {\'item1\':3, \'item2
Pandas can provide another option. Assume data is the input dictionary.
data
import pandas as pd output = {i:s.dropna().to_dict() for i, s in pd.DataFrame(data).T.iteritems()}