title: Find the column that has a certain total number in Python
body: <p>If:</p>
  
  <pre><code>sum(list(map(lambda x : sum(len(y) for y in x.split()), df['column2'].iloc[3])))
  </code></pre>
  
  <p>gets the total character in row number 3 of column number 2 in pandas dataframe <strong>df</strong>, then <strong>how to find the column that has a certain total number</strong> (for example: which index column has the total number of character of 43,382) ? </p>
  
  <p><strong>EDITED</strong>:
  I tried this rather long code:</p>
  
  <pre><code>df.loc[df['column2'] == (sum(list(map(lambda x : sum(len(y) for y in x.split()), df['column2'])))).isin('43382')]
  </code></pre>
  
  <p>but I got error message:</p>
  
  <pre><code>AttributeError: 'int' object has no attribute 'isin'
  </code></pre>
  
  <p>This is how my dataframe <strong>df</strong> looks like"</p>
  
  <pre><code>column1      column2                                            column3
  amsterdam    school yeah right backtic escapes sport swimming   2016
  rotterdam    nope yeah                                          2012
  thehague     i now i can fly no you cannot swimming rope        2010
  amsterdam    sport cycling in the winter makes me               2019
  </code></pre>