title: dummy variables in pandas based on values
body: <p>I would like to create a dummy variable in pandas which has the value of 1 if the value in column A is greater than 0, and 0 if otherwise. This dummy should be stored in a new column, G.</p>
  
  <pre><code>               A         B         C         D         E         F  
  2016-01-01  0.571650  0.427669  0.090381 -0.765132 -1.164994  0.244477   
  2016-01-02  0.834616  0.938302 -0.428445 -0.067147  0.126845  0.783122   
  2016-01-03  1.996946 -0.178791  1.478010  0.424868  2.311478 -0.357036   
  2016-01-04  0.423200  0.229080  1.414170  0.258490  0.931763  0.096947   
  2016-01-05 -0.400117 -0.785149  1.748607  1.777462 -0.509319  0.314151
  </code></pre>
  
  <p>Currently, I have this</p>
  
  <pre><code>a = []
  for row in df['A']:
      if row &gt; 0:
          a.append(1)
      else:
          a.append(0)
  df['G'] = a
  </code></pre>
  
  <p>This works, but I have the gut feeling there must be a better, simpler way of doing this?</p>