# Path: seaborn/_statistics.py
# class KDE:
# class Histogram:
# class ECDF:
# class EstimateAggregator:
#     def __init__(
#         self, *,
#         bw_method=None,
#         bw_adjust=1,
#         gridsize=200,
#         cut=3,
#         clip=None,
#         cumulative=False,
#     ):
#     def _define_support_grid(self, x, bw, cut, clip, gridsize):
#     def _define_support_univariate(self, x, weights):
#     def _define_support_bivariate(self, x1, x2, weights):
#     def define_support(self, x1, x2=None, weights=None, cache=True):
#     def _fit(self, fit_data, weights=None):
#     def _eval_univariate(self, x, weights=None):
#     def _eval_bivariate(self, x1, x2, weights=None):
#     def __call__(self, x1, x2=None, weights=None):
#     def __init__(
#         self,
#         stat="count",
#         bins="auto",
#         binwidth=None,
#         binrange=None,
#         discrete=False,
#         cumulative=False,
#     ):
#     def _define_bin_edges(self, x, weights, bins, binwidth, binrange, discrete):
#     def define_bin_params(self, x1, x2=None, weights=None, cache=True):
#     def _eval_bivariate(self, x1, x2, weights):
#     def _eval_univariate(self, x, weights):
#     def __call__(self, x1, x2=None, weights=None):
#     def __init__(self, stat="proportion", complementary=False):
#     def _eval_bivariate(self, x1, x2, weights):
#     def _eval_univariate(self, x, weights):
#     def __call__(self, x1, x2=None, weights=None):
#     def __init__(self, estimator, errorbar=None, **boot_kws):
#     def __call__(self, data, var):
# def _percentile_interval(data, width):
# def _validate_errorbar_arg(arg):
#     DEFAULT_LEVELS = {
#         "ci": 95,
#         "pi": 95,
#         "se": 1,
#         "sd": 1,
#     }


import numpy as np
import pandas as pd
    import statsmodels.distributions as smdist
import pytest
from numpy.testing import assert_array_equal, assert_array_almost_equal
from .._statistics import (
    KDE,
    Histogram,
    ECDF,
    EstimateAggregator,
    _validate_errorbar_arg,
    _no_scipy,
)
class TestECDF(DistributionFixtures):

    def test_univariate_proportion(self, x):

        ecdf = ECDF()
        stat, vals = ecdf(x)
        assert_array_equal(vals[1:], np.sort(x))
        assert_array_almost_equal(stat[1:], np.linspace(0, 1, len(x) + 1)[1:])
        assert stat[0] == 0

    def test_univariate_count(self, x):

        ecdf = ECDF(stat="count")
        stat, vals = ecdf(x)

        assert_array_equal(vals[1:], np.sort(x))
        assert_array_almost_equal(stat[1:], np.arange(len(x)) + 1)
        assert stat[0] == 0

    def test_univariate_proportion_weights(self, x, weights):

        ecdf = ECDF()
        stat, vals = ecdf(x, weights=weights)
        assert_array_equal(vals[1:], np.sort(x))
        expected_stats = weights[x.argsort()].cumsum() / weights.sum()
        assert_array_almost_equal(stat[1:], expected_stats)
        assert stat[0] == 0

    def test_univariate_count_weights(self, x, weights):


# Path: seaborn/_statistics.py
# class KDE:
# class Histogram:
# class ECDF:
# class EstimateAggregator:
#     def __init__(
#         self, *,
#         bw_method=None,
#         bw_adjust=1,
#         gridsize=200,
#         cut=3,
#         clip=None,
#         cumulative=False,
#     ):
#     def _define_support_grid(self, x, bw, cut, clip, gridsize):
#     def _define_support_univariate(self, x, weights):
#     def _define_support_bivariate(self, x1, x2, weights):
#     def define_support(self, x1, x2=None, weights=None, cache=True):
#     def _fit(self, fit_data, weights=None):
#     def _eval_univariate(self, x, weights=None):
#     def _eval_bivariate(self, x1, x2, weights=None):
#     def __call__(self, x1, x2=None, weights=None):
#     def __init__(
#         self,
#         stat="count",
#         bins="auto",
#         binwidth=None,
#         binrange=None,
#         discrete=False,
#         cumulative=False,
#     ):
#     def _define_bin_edges(self, x, weights, bins, binwidth, binrange, discrete):
#     def define_bin_params(self, x1, x2=None, weights=None, cache=True):
#     def _eval_bivariate(self, x1, x2, weights):
#     def _eval_univariate(self, x, weights):
#     def __call__(self, x1, x2=None, weights=None):
#     def __init__(self, stat="proportion", complementary=False):
#     def _eval_bivariate(self, x1, x2, weights):
#     def _eval_univariate(self, x, weights):
#     def __call__(self, x1, x2=None, weights=None):
#     def __init__(self, estimator, errorbar=None, **boot_kws):
#     def __call__(self, data, var):
# def _percentile_interval(data, width):
# def _validate_errorbar_arg(arg):
#     DEFAULT_LEVELS = {
#         "ci": 95,
#         "pi": 95,
#         "se": 1,
#         "sd": 1,
#     }


# Path: seaborn/tests/test_statistics.py
import numpy as np
import pandas as pd
    import statsmodels.distributions as smdist
import pytest
from numpy.testing import assert_array_equal, assert_array_almost_equal
from .._statistics import (
    KDE,
    Histogram,
    ECDF,
    EstimateAggregator,
    _validate_errorbar_arg,
    _no_scipy,
)

class TestECDF(DistributionFixtures):

    def test_univariate_proportion(self, x):

        ecdf = ECDF()
        stat, vals = ecdf(x)
        assert_array_equal(vals[1:], np.sort(x))
        assert_array_almost_equal(stat[1:], np.linspace(0, 1, len(x) + 1)[1:])
        assert stat[0] == 0

    def test_univariate_count(self, x):

        ecdf = ECDF(stat="count")
        stat, vals = ecdf(x)

        assert_array_equal(vals[1:], np.sort(x))
        assert_array_almost_equal(stat[1:], np.arange(len(x)) + 1)
        assert stat[0] == 0

    def test_univariate_proportion_weights(self, x, weights):

        ecdf = ECDF()
        stat, vals = ecdf(x, weights=weights)
        assert_array_equal(vals[1:], np.sort(x))
        expected_stats = weights[x.argsort()].cumsum() / weights.sum()
        assert_array_almost_equal(stat[1:], expected_stats)
        assert stat[0] == 0

    def test_univariate_count_weights(self, x, weights):


        ecdf = ECDF(stat="count")