title: I had "ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()." error while writing a function
body: <p>Guys I am trying to write such a function. When the value of the data frame's column is less than 30, it should be equal to 1 otherwise, it should be equal to 0 but when I try to apply this function to my own data
  it didn't work</p>
  <pre><code>def age_flag(dataframe,column):
      if pd.DataFrame({column:dataframe[column]}) &lt; 30:
          return dataframe[column] == 1
      else:
          return dataframe[column] == 0
  </code></pre>