title: How to get count of each item in a list
body: <p>I have csv where it reads transaction like as follows</p>
  
  <p>Diaper Cola Paste</p>
  
  <p>Diaper Cola Pen</p>
  
  <p>I would like to get the count of each transaction items as follows:</p>
  
  <p>Diaper:1 Cola:1 Paste:1</p>
  
  <p>Diaper:1 Cola:1 Pen:1</p>
  
  <p>The code i tried is :</p>
  
  <pre><code>from collections import Counter
  
  def M():
      list=[]
      DataCaptured= csv.reader(Datafile,delimiter=" ")
      for row in DataCaptured:
          list.append(row)
      Counter(list)
  </code></pre>
  
  <p>I am getting list is unhashable error.</p>