benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 46b4a767-9674-53b6-a115-d4b483d4310c

Problem

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

complete prompt

import numpy as np
import datetime

def task_func(arr):
    """
    Reverse the order of words separated by. "" in all strings of a numpy array.

    Parameters:
    - arr (numpy array): The numpy array.

    Returns:
    - numpy.ndarray: The numpy array with the strings reversed.

    Requirements:
    - numpy
    - datetime

    Example:
    >>> arr = np.array(['apple.orange', 'red.green.yellow'])
    >>> reversed_arr = task_func(arr)
    >>> print(reversed_arr)
    ['orange.apple' 'yellow.green.red']
    """

instruct prompt

Reverse the order of words separated by. "" in all strings of a numpy array.
The function should output with:
    numpy.ndarray: The numpy array with the strings reversed.
You should write self-contained code starting with:

Code

import numpy as np
import datetime
def task_func(arr):

code prompt

Code

import numpy as np
import datetime
def task_func(arr):

entry point

task_func

libs

  • datetime
  • numpy

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