title: How to perform bincount on an array of strings?
body: <p>I have NumPy array containing string values.   </p>
  
  <p>For instance: ["bus", "bar", "bar", "café" .....]  </p>
  
  <p>What is the best way of counting the number of occurrences of each element in my array. My current solution is:</p>
  
  <pre><code># my_list contains my data.
  bincount = []
  for name in set(my_list.tolist()):
      count = sum([1 for elt in my_list if elt == name])
      bincount.append(count)  
  </code></pre>
  
  <p>I have tried bincount but it does not work with this type of data.  </p>
  
  <p>Do you know a better solution?</p>