title: Counting occurrences of elements in a pandas series containing lists
body: <p>I've been working with large lists of data, where each element is a single string, ex: </p>
  
  <pre><code>["apple", "egg", "carrot", "milk", "apple", "apple"]
  </code></pre>
  
  <p>I've been turning these into pandas Series and then using value_counts() to count the occurrences of each unique item in the list. However, now I'm facing lists that contain lists: </p>
  
  <pre><code>["apple", ["apple", "egg"], "egg", "carrot", ["milk", "egg"], 
   ["milk", "apple", "carrot"], "apple"]
  </code></pre>
  
  <p>I'm looking for a way to count the occurrences of each unique list in addition to each unique string. </p>
  
  <p>I've tried turning these lists of lists into series and using value_counts() on them, but it throws an <code>unhashable type: list</code> error. I get the same error when I change these sublists to sets or ndarrays.</p>
  
  <p>I could always throw these lists into a bunch of for loops but I don't know if my computer has the computational power to do that in any reasonable amount of time. I'd love something that works with similar speed to value_counts(), but I can't for the life of me figure out how to implement it. Any insight would be appreciated.</p>