benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 71e6af56-7ab4-5dc2-a15c-ed7e45c0ceb9

Problem

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

complete prompt

import numpy as np
import pandas as pd

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

def task_func(length, min_value = 0, max_value = 100):
    """
    Randomly generate a pandas DataFrame with specified ranges and length, and calculate the cumulative distribution function (CDF).

    Parameters:
    length (int): The length of the DataFrame to be generated.
    min_value (int, optional): The minimum value for random data generation. Default is 0.
    max_value (int, optional): The maximum value for random data generation. Default is 100.

    Returns:
    DataFrame: A pandas DataFrame with the calculated cumulative distribution function (CDF).

    Note:
    - DataFrame columns are defined by the COLUMNS constant.

    Requirements:
    - numpy
    - pandas
    - matplotlib.pyplot

    Example:
    >>> np.random.seed(0)
    >>> cdf = task_func(100, 0, 1)
    >>> print(len(cdf))
    1
    """

instruct prompt

Randomly generate a pandas DataFrame with specified ranges and length, and calculate the cumulative distribution function (CDF).
Note that: DataFrame columns are defined by the COLUMNS constant.
The function should output with:
    DataFrame: A pandas DataFrame with the calculated cumulative distribution function (CDF).
You should write self-contained code starting with:

Code

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

code prompt

Code

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

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