title: Fill panda columns with conditions
body: <p>I'm trying to fill a column C with conditions: if the value of column B is None, then fill column C with the value of column A. If column B is not None, then fill column C with the value 3</p>
  
  <p><strong>I tried:</strong></p>
  
  <pre><code>import pandas
  df = pandas.DataFrame([{'A': 5, 'B': None, 'C': ''},
                     {'A': 2, 'B': "foo", 'C': ''},
                     {'A': 6, 'B': "foo", 'C': ''},
                     {'A': 1, 'B': None, 'C': ''}])
  
  df["C"] = df["B"].apply(lambda x: 3 if (x != None) else df["A"])
  </code></pre>
  
  <p><strong>My output:</strong> </p>
  
  <blockquote>
    <p>TypeError: object of type 'int' has no len()</p>
  </blockquote>
  
  <p>I know the problem is df["A"], but I don't know how to solve it</p>
  
  <p><strong>Good output:</strong></p>
  
  <pre><code>df = pandas.DataFrame([{'A': 5, 'B': None, 'C': 5},
                     {'A': 2, 'B': "foo", 'C': 3},
                     {'A': 6, 'B': "foo", 'C': 3},
                     {'A': 1, 'B': None, 'C': 1}])
  </code></pre>