From 4a61f775826ed6bc9ca480f532b5d06841082927 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 614f5b905a4a2eb..89e597a19b2d54b 100644 --- a/Doc/library/statistics.rst +++ b/Doc/library/statistics.rst @@ -309,6 +309,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