title: I need to analyze all rows in a dataframe and check if a value exists in any column
body: <p>I am currently trying to check if a value exists in each row of a dataframe and if it is the case, a variable value should change. I am thinking about something like this:</p>
  <pre><code>import pandas as pd
  
  d1 = {'1': ['1.1.1.1', '2.2.2.2'], '2': ['molear', 'laurylh'], '3': [&quot;131&quot;, &quot;132&quot;], '4': [&quot;3&quot;, &quot;4&quot;], '5': [&quot;133&quot;, &quot;131&quot;], '6': [&quot;3&quot;, &quot;4&quot;]}
  df1 = pd.DataFrame(data=d1)
  
  C=&quot;0&quot;
  
  for i1 in df1.loc[0]:
      if (i1==&quot;131&quot;):
          C=&quot;Result1&quot;  
  </code></pre>
  <p>But this only works for the first row. Is there a way to do this for every row in a dataframe? The idea is to make a second dataframe which will store the C value in every row related to the df1. Thanks!</p>