title: NameError: ("name 'true' is not defined", 'occurred at index 0')
body: <pre><code>import pandas as pd
  df = pd.read_csv(r'C:\Users\dd\Desktop\test.csv')
  df
  </code></pre>
  
  <p>Out</p>
  
  <pre><code>userid  url
  0   123 x.com
  1   345 y.com
  </code></pre>
  
  <p>Code</p>
  
  <pre><code>def create_dict(row):
      return ({"userid" : row.userid ,"data": {"url": row.url},"bool":true})
  </code></pre>
  
  <p>I dont want to give <code>true</code> to <code>'true'</code> because i am hitting the api. I need to return as <code>true</code> only</p>
  
  <p>Apply</p>
  
  <p><code>df['out'] = df.apply(lambda row: create_dict(row), axis=1)</code></p>
  
  <p>Expected out</p>
  
  <pre><code>userid  url results
  0   123 x.com   {'userid': 123, 'data': {'url': 'x.com'}, 'bool': true}
  1   345 y.com   {'userid': 345, 'data': {'url': 'y.com'}, 'bool': true}
  </code></pre>
  
  <p>Deisclaimer : please dont make this as duplicate as</p>
  
  <p>by doing <code>return ({"userid" : row.userid ,"data": {"url": row.url},"bool":"true"})</code></p>