incorrect string representation of Infinity
Open
Nobody has claimed this yet.
bug
P3
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 21
Description
When floating point data include Infinity, plotly returns string %{customdata[0]}instead ofInfinity`. Illustrated on hover data of the top right sample:
import plotly.express as px
import numpy as np
import pandas as pd
df = pd.DataFrame({'x': [0, 1, 2, 3, 4], 'y': [0, 1, 4, 9, 16], 'hover_data': [1, 2, 3, 4, np.inf]})
fig = px.scatter(data_frame=df, x='x', y='y', hover_data=['hover_data'])
fig.show()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the hover-data issue with the Python example in the report, focusing on how the final np.inf value is converted before the hover text is displayed. Done means the same example renders Infinity rather than the literal %{customdata[0]} placeholder, with coverage for the failing case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, pandas, python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100