From b55ce9ad5f803888535c125c92692fd179464f14 Mon Sep 17 00:00:00 2001 From: Mr-Neutr0n <64578610+Mr-Neutr0n@users.noreply.github.com> Date: Fri, 6 Feb 2026 04:20:22 +0530 Subject: [PATCH] Fix numpy 2.4.0 compatibility in create_violin() Fixes #5461 The 'interpolation' parameter was deprecated in numpy.percentile() and removed in numpy 2.4.0. It has been replaced with the 'method' parameter which uses the same values. Changed all three np.percentile() calls in calc_stats() from using 'interpolation' to 'method'. --- plotly/figure_factory/_violin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plotly/figure_factory/_violin.py b/plotly/figure_factory/_violin.py index 55924e69238..285733fefd8 100644 --- a/plotly/figure_factory/_violin.py +++ b/plotly/figure_factory/_violin.py @@ -17,9 +17,9 @@ def calc_stats(data): x = np.asarray(data, float) vals_min = np.min(x) vals_max = np.max(x) - q2 = np.percentile(x, 50, interpolation="linear") - q1 = np.percentile(x, 25, interpolation="lower") - q3 = np.percentile(x, 75, interpolation="higher") + q2 = np.percentile(x, 50, method="linear") + q1 = np.percentile(x, 25, method="lower") + q3 = np.percentile(x, 75, method="higher") iqr = q3 - q1 whisker_dist = 1.5 * iqr