benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf d4c3c7cd-8547-5bf4-9d01-816c388e6560

Problem

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

complete prompt

import numpy as np
import random

# Constants
ELEMENTS = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']

def task_func(l=None):
    """
    Create a numeric array from a list "l" and move the first 3 elements to the end of the array.

    Parameters:
    - l (list): A list of elements to be processed.

    Returns:
    - arr (numpy.ndarray): The processed array with the first three elements moved to the end.

    Requirements:
    - numpy
    - random

    Example:
    >>> random.seed(42)
    >>> task_func()
    array(['I', 'F', 'G', 'J', 'E', 'A', 'B', 'H', 'D', 'C'], dtype='<U1')
    """

instruct prompt

Create a numeric array from a list "l" and move the first 3 elements to the end of the array.
The function should output with:
    arr (numpy.ndarray): The processed array with the first three elements moved to the end.
You should write self-contained code starting with:

Code

import numpy as np
import random
# Constants
ELEMENTS = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
def task_func(l=None):

code prompt

Code

import numpy as np
import random
# Constants
ELEMENTS = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
def task_func(l=None):

entry point

task_func

libs

  • numpy
  • 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