I have a function uniqueList that is below :
Def uniqueList(origList):
nodups= {} for temp in origList: nodups[temp] = None returns nodups.keys()
When used in the following context :
industryList = uniqueList(jpbarradata[group])
where jpbarradata[group] might look like
[“AAA BC”,BBB KK”,”CCC TD”,”AAA KP”,”CCC TD”]
,the function works in the sense that it would return
[“AAA BC”,”BBB KK”,”CCC TD”,AAA KP”]
because CCC TD is duplicated.
But, I also want it to get rid of the AAA KP because there are two AAA’s even though the last two letters are different. It doesn’t matter to me which one is gotten rid of but I don’t know how to change the function to handle this ? I have a feeling it’s not that hard though ? Thanks.
|
-- http://mail.python.org/mailman/listinfo/python-list