radar_plot fails on pandas 3 (data.loc with 1-tuple key)
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- data-visualization
Research direction
Start with evaluate.visualization.radar_plot and inspect the loop that builds labels and accesses data.loc; the issue identifies the failing test as tests/test_viz.py::TestViz::test_output_is_plot. Run that test with pandas 3.x to reproduce the error. Done when the plot succeeds and its legend labels are model names rather than one-item tuples.
Written by the indexing model from the issue text.
Description
evaluate.visualization.radar_plot raises on pandas 3.x:
from evaluate.visualization import radar_plot
data = [{"accuracy": 0.99, "latency_in_seconds": 0.5}, {"accuracy": 0.98, "latency_in_seconds": 1.2}]
radar_plot(data, ["model1", "model2"], ["latency_in_seconds"])
ValueError: zip() argument 2 is longer than argument 1
(pandas 3.0.6; tests/test_viz.py::TestViz::test_output_is_plot fails the same way.)
Cause: the loop is for g in zip(data.index), so g is a 1-tuple ("model1",). data.loc[("model1",)] is interpreted by pandas 3 as a multi-axis key. The legend label also becomes the tuple. Iterating data.index directly fixes both. I have a one-line patch ready.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 380
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from huggingface/evaluate
-
exact_match: ignore_punctuation only removes ASCII punctuationPossibly taken @reginaldalfret claimed this 20 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
huggingface/evaluate#836 ·
-
EvaluationSuite.run fails with default args_for_task and mutates supplied kwargsPossibly taken @ktz03 claimed this 32 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
huggingface/evaluate#825 ·
-
exact_match scores two different answers as a perfect match when normalization erases both to the same residuePossibly taken @MahendraMula claimed this 49 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
huggingface/evaluate#822 ·
-
Perplexity metric fails with GPT-2 tokenizerPossibly taken @zanvari claimed this 147 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
huggingface/evaluate#766 · 1 comment ·
-
False/misleading instruction to use different checkpoints of BLEURTMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 62/100
huggingface/evaluate#679 · 1 reaction ·
All issues in huggingface/evaluate
Similar issues
-
documentation good first issue priority: P2 status: ready
Difficulty 1/5 Under an hour Newbie friendliness 88/100
RhinoLink-Tech/data-fabric#500 ·
Maintainers usually reply within 1 day
-
backlog
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EchoTools/nevr-runtime#2384 ·
Maintainers usually reply within 1 day
-
[Bug]: The H2 series' and the H3C's fan 3 is labelled "Chamber Fan", Bambu calls it the exhaust fanOpenarea:ui
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
btclib-org/btclib#3062 ·
Maintainers usually reply within 1 day
-
area:evals area:infra enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
jse-avl/support-bot#4 · 1 comment ·