benchmarks.wiki / Public workspace
BigCodeBench / BigCodeBench v0.1.0_hf 48b06b15-43b0-5cac-afb2-e180d2ddeac0
Problem
Answer published by the source. Consult the official source to check your work against its answer.
complete prompt
import heapq
import math
import matplotlib.pyplot as plt
def task_func(l1, l2, N=10):
"""
Find the N biggest differences between the respective elements of the list 'l1' and list 'l2',
square the differences, take the square root and return the plotted values as a matplotlib Axes object.
Parameters:
l1 (list): A list of numbers.
l2 (list): A list of numbers.
N (int): Number of largest differences to consider. Default is 10.
Returns:
matplotlib.axes._axes.Axes: A matplotlib Axes object with the plotted differences.
Requirements:
- heapq
- math
- matplotlib.pyplot
Example:
>>> l1 = [99, 86, 90, 70, 86, 95, 56, 98, 80, 81]
>>> l2 = [21, 11, 21, 1, 26, 40, 4, 50, 34, 37]
>>> ax = task_func(l1, l2)
>>> type(ax)
<class 'matplotlib.axes._axes.Axes'>
"""
instruct prompt
Find the N biggest differences between the respective elements of the list 'l1' and list 'l2', square the differences, take the square root and return the plotted values as a matplotlib Axes object.
The function should output with:
matplotlib.axes._axes.Axes: A matplotlib Axes object with the plotted differences.
You should write self-contained code starting with:
Code
import heapq
import math
import matplotlib.pyplot as plt
def task_func(l1, l2, N=10):
code prompt
Code
import heapq
import math
import matplotlib.pyplot as plt
def task_func(l1, l2, N=10):
entry point
task_func
libs
- math
- matplotlib
- heapq
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
initial import