benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf caa46e51-389a-553e-bdca-06fc020f36e9

Problem

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

complete prompt

from random import randint
import matplotlib.pyplot as plt
import numpy as np


def task_func(array_length=100):
    """
    Generate two arrays of random integers and draw a line diagram with the 
    maximum values of the respective elements of the two arrays. Set 'Maximum Values' on its y-axis.

    Parameters:
    - array_length (int): Length of the random arrays to be generated. Default is 100.

    Returns:
    - matplotlib.axes.Axes: Axes object with the plot.

    Requirements:
    - numpy
    - matplotlib.pyplot
    - random

    Example:
    >>> ax = task_func(100)
    """

instruct prompt

Generate two arrays of random integers and draw a line diagram with the maximum values of the respective elements of the two arrays. Set 'Maximum Values' on its y-axis.
The function should output with:
    matplotlib.axes.Axes: Axes object with the plot.
You should write self-contained code starting with:

Code

from random import randint
import matplotlib.pyplot as plt
import numpy as np
def task_func(array_length=100):

code prompt

Code

from random import randint
import matplotlib.pyplot as plt
import numpy as np
def task_func(array_length=100):

entry point

task_func

libs

  • numpy
  • matplotlib
  • random

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