title: How to check if an element is an empty list in pandas?
body: <p>One of the column in my df stores a list, and some of the raws have empty items in the list. For example:</p>
  <blockquote>
  <p>[]</p>
  <p>[&quot;X&quot;, &quot;Y&quot;]</p>
  <p>[]</p>
  </blockquote>
  <p>etc...</p>
  <p>How can only take the raw whose list is not empty?</p>
  <p>The following code does not work.</p>
  <pre><code>df[df[&quot;col&quot;] != []] # ValueError: Lengths must match to compare
  df[pd.notnull(df[&quot;col&quot;])] # The code doesn't issue an error but the result includes an empty list
  df[len(df[&quot;col&quot;]) != 0] # KeyError: True
  </code></pre>