title: How to remove a row from pandas dataframe based on the length of the column values?
body: <p>In the following <code>pandas.DataFframe</code>:</p>
  
  <pre><code>df = 
      alfa    beta   ceta
      a,b,c   c,d,e  g,e,h
      a,b     d,e,f  g,h,k
      j,k     c,k,l  f,k,n
  </code></pre>
  
  <p>How to drop the rows in which the column values for alfa has more than 2 elements? This can be done using the length function, I know but not finding a specific answer.</p>
  
  <pre><code>df = df[['alfa'].str.split(',').map(len) &lt; 3]
  </code></pre>