radar_plot fails on pandas 3 (data.loc with 1-tuple key)

Open Beginner friendly
#854 0 comments 0 reactions 0 assignees View on GitHub

@davrens101 is already working on this.

Since Nov 10, 2026.

  • #855 by @davrens101 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
79/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
matplotlib, pandas, python

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from huggingface/evaluate

All issues in huggingface/evaluate

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.