def empirical_cdf(data):
vals = pd.Series(data).value_counts()<EOL>ecdf = pd.DataFrame(data).set_index(keys=<NUM_LIT:0>)<EOL>probs = pd.DataFrame(vals.sort_index().cumsum() / np.float(len(data)))<EOL>ecdf = ecdf.join(probs)<EOL>ecdf = ecdf.reset_index()<EOL>ecdf.columns = ['<STR_LIT:data>', '<STR_LIT>']<EOL>return ecdf<EOL>
Generates an empirical cdf from data

Parameters
----------
data : iterable
    Empirical data

Returns
--------
DataFrame
    Columns 'data' and 'ecdf'. 'data' contains ordered data and 'ecdf'
    contains the corresponding ecdf values for the data.