title: numpy/scipy equivalent of R ecdf(x)(x) function?
body: <p>What is the equivalent of R's <code>ecdf(x)(x)</code> function in Python, in either numpy or scipy? Is <code>ecdf(x)(x)</code> basically the same as:</p>
  
  <pre><code>import numpy as np
  def ecdf(x):
    # normalize X to sum to 1
    x = x / np.sum(x)
    return np.cumsum(x)
  </code></pre>
  
  <p>or is something else required?</p>
  
  <p><strong>EDIT</strong> how can one control the number of bins used by <code>ecdf</code>? </p>