<jupyter_start><jupyter_text>ECDFsIn my two SciPy 2018 co-taught tutorials, I made the case that ECDFs provide richer information compared to histograms. My main points were:1. We can more easily identify central tendency measures, in particular, the median, compared to a histogram.1. We can much more easily identify other percentile values, compared to a histogram.1. We become less susceptible to outliers arising from binning issues.1. It is more difficult to hide multiple modes.1. We can easily identify repeat values. To illustrate, let's take a look at the following plots.<jupyter_code>import numpy as np
import matplotlib.pyplot as plt

# Generate a mixture of two normal distributions, but with
# very few data points.
np.random.seed(3)
mx1 = np.random.normal(loc=0, scale=1, size=20)
mx2 = np.random.normal(loc=2, scale=1, size=20)
mx = np.concatenate([mx1, mx2, [5], [-4]])  # one outlier

def ecdf(data):
    x, y = np.sort(data), np.arange(1, len(data)+1) / len(data)
    return x, y

fig = plt.figure(figsize=(8, 4))
ax_ecdf = fig.add_subplot(121)
ax_hist = fig.add_subplot(122)
ax_hist.set_title('histogram')

ax_hist.hist(mx)

x, y = ecdf(mx)
ax_ecdf.scatter(x, y)
ax_ecdf.set_title('ecdf')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10653753026634383, 'fraction_numerical': 0.02744148506860371, 'mean_word_length': 4.990338164251208, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '337916', 'license': 'MIT', 'n_tokens_mistral': 446, 'n_tokens_neox': 420, 'n_words': 148, 'path': 'notebooks/ecdfs.ipynb', 'repo_name': 'Supr4pt0/bayesian-analysis-recipes', 'size': '1239'}