benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 2ca364f4-f876-5caa-835d-7aeb294734d0

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
RANGE = (1, 100)

def task_func(L):
    '''
    Generates a DataFrame filled with random integers. The dimensions of the DataFrame (number of rows and columns)
    are determined by multiplying pairs of integers from nested lists within the input list of lists 'L'.
    
    Requirements:
    - numpy
    - pandas

    Parameters:
    L (list of lists): A list of lists where each sublist contains two integers.
    
    Returns:
    DataFrame: A pandas DataFrame with random integers.
    
    Example:
    >>> df = task_func([[2, 3], [5, 6]])
    >>> type(df)
    <class 'pandas.core.frame.DataFrame'>
    '''

instruct prompt

Generates a DataFrame filled with random integers. The dimensions of the DataFrame (number of rows and columns) are determined by multiplying pairs of integers from nested lists within the input list of lists 'L'.
The function should output with:
    DataFrame: A pandas DataFrame with random integers.
You should write self-contained code starting with:

Code

import numpy as np
import pandas as pd
# Constants
RANGE = (1, 100)
def task_func(L):

code prompt

Code

import numpy as np
import pandas as pd
# Constants
RANGE = (1, 100)
def task_func(L):

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