Re: generating unique set of dicts from a list of dicts

2012-01-10 Thread Dave Angel
On 01/10/2012 03:24 PM, bruce wrote: Since dict_hash returns a string, which is immutable, you can now use a dictionary to find the unique elements: uniques_map = {} for d in list_of_dicts: uniques[dict_hash(d)] = d unique_dicts = uniques_map.values() *** not sure what the "uniqes" is, o

generating unique set of dicts from a list of dicts

2012-01-10 Thread bruce
trying to figure out how to generate a unique set of dicts from a json/list of dicts. initial list ::: [{"pStart1a": {"termVal":"1122","termMenu":"CLASS_SRCH_WRK2_STRM","instVal":"OSUSI", "instMenu":"CLASS_SRCH_WRK2_INSTITUTION","goBtn":"CLASS_SRCH_WRK2_SSR_PB_SRCH", "pagechk":"CLASS_SRCH_WRK2_SS