benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf b363af6f-409a-5380-a097-1b9d891cb154

Problem

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

complete prompt

import pandas as pd
import numpy as np

# Constants
COLUMNS = ['Column1', 'Column2', 'Column3', 'Column4', 'Column5']

def task_func(length):
    """
    Generate a Pandas DataFrame with specified length and random data and then record the data.

    Parameters:
    length (int): The length of the DataFrame to be generated.

    Returns:
    DataFrame: A pandas DataFrame with random data.

    Requirements:
    - pandas
    - numpy

    Example:
    >>> np.random.seed(0)
    >>> df = task_func(5)
    >>> df.shape
    (5, 5)
    """

instruct prompt

Generate a Pandas DataFrame with specified length and random data and then record the data.
The function should output with:
    DataFrame: A pandas DataFrame with random data.
You should write self-contained code starting with:

Code

import pandas as pd
import numpy as np
# Constants
COLUMNS = ['Column1', 'Column2', 'Column3', 'Column4', 'Column5']
def task_func(length):

code prompt

Code

import pandas as pd
import numpy as np
# Constants
COLUMNS = ['Column1', 'Column2', 'Column3', 'Column4', 'Column5']
def task_func(length):

entry point

task_func

libs

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