benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf fc648ed2-3ac4-537d-810b-d245ec921d33

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
LETTERS = list('abcdefghijklmnopqrstuvwxyz')
OUTPUT_DIR = './output'


def task_func(file_path, output_dir=OUTPUT_DIR):
    """
    Create a CSV file containing a 2D matrix populated exclusively with random lowercase letters.
    
    Parameters:
    - file_path (str): The path of the CSV file to be created.
    - output_dir (str, optional): The dir of the CSV file to be created.
    
    Returns:
    None: Writes a CSV file to the specified path.
    
    Requirements:
    - pandas
    - numpy

    Example:
    >>> task_func(os.path.join(OUTPUT_DIR, 'random_matrix.csv'))
    """

instruct prompt

Create a CSV file containing a 2D matrix populated exclusively with random lowercase letters.
The function should output with:
    None: Writes a CSV file to the specified path.
You should write self-contained code starting with:

Code

import numpy as np
import pandas as pd
# Constants
LETTERS = list('abcdefghijklmnopqrstuvwxyz')
OUTPUT_DIR = './output'
def task_func(file_path, output_dir=OUTPUT_DIR):

code prompt

Code

import numpy as np
import pandas as pd
# Constants
LETTERS = list('abcdefghijklmnopqrstuvwxyz')
OUTPUT_DIR = './output'
def task_func(file_path, output_dir=OUTPUT_DIR):

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