title: How to check if a parameter is passed to a function?
body: <p>I'm trying to figure out how to check if a dataframe is passed or not as a parameter</p>
  
  <pre class="lang-py prettyprint-override"><code>def mean_encoding_with_reg (df,var,alpha,y,test=False): 
  
      if test!=False:
          test.set_index(var,inplace=True)
          test['cat_'+str(var)] = a.mean_y
          test.reset_index(inplace=True)
          test.drop(var,inplace=True,axis=1)
  
      return df,test  
  
  </code></pre>
  
  <p>In case I pass a test param I get the following message:</p>
  
  <pre><code>ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
  </code></pre>