<br><br><div class="gmail_quote">On Thu, Mar 26, 2009 at 5:14 PM,  <span dir="ltr"><<a href="mailto:Paul.Scipione@aps.com">Paul.Scipione@aps.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi D'Arcy J.M. Cain,<br>
<br>
Thank you.  I tried this and my list of 76,979 integers got reduced to a dictionary of 76,963 items, each item listing the integer value from the list, a comma, and a 1.  I think what this is doing is finding all integers from my list that are unique (only one instance of it in the list), instead of creating a dictionary with integers that are not unique, with a count of how many times they occur.  My dictionary should contain only 11 items listing 11 integer values and the number of times they appear in my original list.<br>

</blockquote><div><br><br>Not all of the values are 1. The 11 duplicates will be higher. Just iterate through the dict to find all keys with values > 1.<br><br>>>> icounts<br>{1: 2, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 5, 8: 3, 9: 1, 10: 1, 11: 1}<br>
<br>Python 2.x :<br>>>> dups = {}<br>>>> for key, value in icounts.iteritems() :<br>...    if value > 1 :<br>...       dups[key] = value<br>... <br>>>> dups<br>{8: 3, 1: 2, 7: 5}<br><br><br>Python 3.0 :<br>
>>> dups = {key:value for key, value in icounts.items() if value > 1}<br>>>> dups<br>{8: 3, 1: 2, 7: 5}<br><br><br></div></div><br>