Optimal histogram bin width based on the Freedman-Diaconis rule

def _heuristic_bin_width(obs):
    """Optimal histogram bin width based on the Freedman-Diaconis rule"""
    IQR = sp.percentile(obs, 75) - sp.percentile(obs, 25)
    N = len(obs)
    return 2*IQR*N**(-1/3)