benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 0ef018d3-927d-5e1d-b5f3-e6bb75d28b6d

Problem

Answer published by the source. Consult the official source to check your work against its answer.

complete prompt

import numpy as np
from operator import itemgetter
import matplotlib.pyplot as plt


def task_func(data):
    """
    Plot a scatter graph of tuples and highlight the tuple with the maximum value at index 1.
    
    Parameters:
    data (list of tuple): A list of tuples where each tuple contains two integers.
    
    Returns:
    matplotlib.axes.Axes: The Axes object of the plot for further manipulation and testing, with the title 'Max Tuple Highlighted', x-axis labeled 'x', y-axis labeled 'y', and a legend.
    
    Requirements:
    - numpy
    - operator
    - matplotlib.pyplot
    
    Example:
    >>> ax = task_func([(10, 20), (30, 40), (25, 50)])
    >>> type(ax)
    <class 'matplotlib.axes._axes.Axes'>
    """

instruct prompt

Plot a scatter graph of tuples and highlight the tuple with the maximum value at index 1.
The function should output with:
    matplotlib.axes.Axes: The Axes object of the plot for further manipulation and testing, with the title 'Max Tuple Highlighted', x-axis labeled 'x', y-axis labeled 'y', and a legend.
You should write self-contained code starting with:

Code

import numpy as np
from operator import itemgetter
import matplotlib.pyplot as plt
def task_func(data):

code prompt

Code

import numpy as np
from operator import itemgetter
import matplotlib.pyplot as plt
def task_func(data):

entry point

task_func

libs

  • operator
  • numpy
  • matplotlib

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import