python: unhashable type error
<pre><code>Traceback (most recent call last):
  File "&lt;pyshell#80&gt;", line 1, in &lt;module&gt;
    do_work()
  File "C:\pythonwork\readthefile080410.py", line 14, in do_work
    populate_frequency5(e,data)
  File "C:\pythonwork\readthefile080410.py", line 157, in populate_frequency5
    data=medications_minimum3(data,[drug.upper()],1)
  File "C:\pythonwork\readthefile080410.py", line 120, in medications_minimum3
    counter[row[11]]+=1
TypeError: unhashable type: 'list'
</code></pre>

<p>i am getting this error on this line:</p>

<pre><code>data=medications_minimum3(data,[drug.upper()],1)
</code></pre>

<p>(i have also tried drug.upper() without brackets</p>

<p>here is a preview of this function:</p>

<pre><code>def medications_minimum3(c,drug_input,sample_cutoff): #return sample cut off for # medications/physician
  d=[]
  counter=collections.defaultdict(int)
  for row in c:
    counter[row[11]]+=1
  for row in c:
    if counter[row[11]]&gt;=sample_cutoff:
      d.append(row) 
  write_file(d,'/pythonwork/medications_minimum3.csv')
  return d
</code></pre>

<p>does anyone know what am i doing wrong here?</p>

<p>i know that what must be wrong is the way i am calling this function, because i call this function from a different location and it works fine:</p>

<pre><code>d=medications_minimum3(c,drug_input,50)
</code></pre>

<p>thank you very much for your help!</p>
