From f1ee8af48e8a921b764180b5433f8e24819d6e7c Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 20 Sep 2026 23:36:33 -0500 Subject: [PATCH] gh-154942: Document the kde() data cache logic. (gh-157725) (cherry picked from commit 5afcd82089b6b1a6cf62b41a428cbe818b867364) Co-authored-by: Raymond Hettinger --- Doc/library/statistics.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst index dba0e26787d9516..9ff30211ebcf157 100644 --- a/Doc/library/statistics.rst +++ b/Doc/library/statistics.rst @@ -306,6 +306,11 @@ However, for reading convenience, most of the examples show sorted sequences. .. image:: kde_example.png :alt: Scatter plot of the estimated probability density function. + Because the returned ``f_hat`` function is typically called many times, + it caches the *data* for performance. To support dynamic datasets, this + cache automatically refreshes whenever the length of the *data* changes. + This allows new samples to be added as they become available. + .. versionadded:: 3.13