title: Pandas: Check if a value exist in a column, create a new column, exist add 1 if not add 0
body: <p>I have a DataFrame</p>
  <pre><code>df = columnA=[1,2,3,4,5,6]
       columnB=['Apple AA','Banana BB',NaN,'Strawberry DD',NaN,'Blueberry EE']
  </code></pre>
  <p>I want to create a new column if columnB contains values</p>
  <pre><code>df = columnA=[1,2,3,4,5,6]
       columnB=['Apple AA','Banana BB',NaN,'Strawberry DD',NaN,'Blueberry EE']
       columnC=[1,1,0,1,0,1]
  </code></pre>
  <p>My code:</p>
  <pre><code>df[columnC] = df[columnB].map(lambda x: 1 if len(x) &gt; 0 else 0 if len(x) == 0)
  </code></pre>
  <p>Or</p>
  <pre><code>columnC = np.repeat(0, df.shape[0]
  for i in df:
     if len(df[columnB]) &gt; 0:
        df[columnC] = 1
  </code></pre>
  <p>Neither are working.</p>