kde.py 923 B

12345678910111213141516171819202122232425262728293031
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.stats` namespace for importing the functions
  3. # included below.
  4. import warnings
  5. from . import _kde
  6. __all__ = [ # noqa: F822
  7. 'gaussian_kde', 'linalg', 'logsumexp', 'check_random_state',
  8. 'atleast_2d', 'reshape', 'newaxis', 'exp', 'ravel', 'power',
  9. 'atleast_1d', 'squeeze', 'sum', 'transpose', 'cov',
  10. 'gaussian_kernel_estimate'
  11. ]
  12. def __dir__():
  13. return __all__
  14. def __getattr__(name):
  15. if name not in __all__:
  16. raise AttributeError(
  17. "scipy.stats.kde is deprecated and has no attribute "
  18. f"{name}. Try looking in scipy.stats instead.")
  19. warnings.warn(f"Please use `{name}` from the `scipy.stats` namespace, "
  20. "the `scipy.stats.kde` namespace is deprecated.",
  21. category=DeprecationWarning, stacklevel=2)
  22. return getattr(_kde, name)