Skip to content

Fix violin plot compatibility with NumPy 2.4+#5505

Open
mosh3eb wants to merge 2 commits intoplotly:mainfrom
mosh3eb:fix/numpy-2.4-violin-compatibility
Open

Fix violin plot compatibility with NumPy 2.4+#5505
mosh3eb wants to merge 2 commits intoplotly:mainfrom
mosh3eb:fix/numpy-2.4-violin-compatibility

Conversation

@mosh3eb
Copy link

@mosh3eb mosh3eb commented Feb 14, 2026

The interpolation parameter was removed in NumPy 2.4.0 and replaced with 'method'. This was causing create_violin() to fail with newer NumPy versions.

Added version detection to use the correct parameter based on the installed NumPy version, maintaining backward compatibility with NumPy 1.x while supporting 2.4+.

Fixes #5461

Code PR

  • I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of plotly.graph_objects, my modifications concern the code generator and not the generated files.
  • I have added tests or modified existing tests.
  • For a new feature, I have added documentation examples (please see the doc checklist as well).
  • I have added a CHANGELOG entry if changing anything substantial.
  • For a new feature or a change in behavior, I have updated the relevant docstrings in the code.

The interpolation parameter was removed in NumPy 2.4.0 and replaced
with 'method'. This was causing create_violin() to fail with newer
NumPy versions.

Added version detection to use the correct parameter based on the
installed NumPy version, maintaining backward compatibility with
NumPy 1.x while supporting 2.4+.

Fixes plotly#5461
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: create_violin() failure with numpy==2.4.0: TypeError: percentile() got an unexpected keyword argument 'interpolation'

1 participant