title: How to write a conditional array operation on a Pandas DataFrame
body: <p>Suppose I have a DataFrame, in which one of the columns (we'll call it 'power') holds integer values from 1 to 10000.  I would like to produce a numpy array which has, for each row, a value indicating whether the corresponding row of the DataFrame has a value in the 'power' column which is greater than 9000. </p>
  
  <p>I could do something like this:</p>
  
  <pre><code>def categorize(frame):
      return np.array(frame['power']&gt;9000)
  </code></pre>
  
  <p>This will give me a boolean array which can be tested against with True and False.  However, suppose I want the contents of the array to be 1 and -1, rather than True and False.  How can I accomplish this without having to iterate through each row in the frame?</p>
  
  <p>For background, the application is preparing data for binary classification via machine learning with scikit-learn.</p>