title: More idiomatic "if-else" replacement in pandas
body: <p>I've seemingly simple problem, based on condition e.g. that value in dataframe is smaller than two, change value to 1, in opposite case to 0. Kind of &quot;if-else&quot;.</p>
  <p>Toy exmample, input:</p>
  <pre><code>   a   b
  0  1  -5
  1  2   0
  2  3  10
  </code></pre>
  <p>Output:</p>
  <pre><code>   a  b
  0  1  1
  1  0  1
  2  0  0
  
  </code></pre>
  <p>Here is my solution:</p>
  <pre><code>import pandas as pd
  import numpy as np
  
  
  df = pd.DataFrame({'a': [1,2,3], 'b': [-5, 0, 10]})
  
  arr = np.where(df &lt; 2, 1, 0)
  df_fin = pd.DataFrame(data=arr, index=df.index, columns=df.columns)
  </code></pre>
  <p>I don't like direct dependency on <code>numpy</code> and it also a little looks verbose to me. Could it be done in more cleaner, idiomatic way?</p>