benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf a3620448-2995-5bb1-b62c-1ad7af14964a

Problem

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

complete prompt

import os
import time
OUTPUT_DIR = './output'


def task_func(dataset, filename, output_dir=OUTPUT_DIR):
    """
    Writes multiple Pandas DataFrames to a single CSV file, separating each DataFrame by a line of hyphens ("------").

    Parameters:
    - dataset (list of pd.DataFrame): A list containing the DataFrames to be written to the file.
    - filename (str): The name of the file (excluding the path) where the DataFrames will be written.
    - output_dir (str, optional): the ouput directory.

    Returns:
    None: The function writes the DataFrames to a CSV file but does not return any value.

    Requirements:
    - os
    - time

    Example:
    >>> import pandas as pd
    >>> df1 = pd.DataFrame({"A": [1, 2], "B": [3, 4]})
    >>> df2 = pd.DataFrame({"D": [5, 6], "E": [7, 8]})
    >>> task_func([df1, df2], 'sample.csv')
    """

instruct prompt

Writes multiple Pandas DataFrames to a single CSV file, separating each DataFrame by a line of hyphens ("------").
The function should output with:
    None: The function writes the DataFrames to a CSV file but does not return any value.
You should write self-contained code starting with:

Code

import os
import time
OUTPUT_DIR = './output'
def task_func(dataset, filename, output_dir=OUTPUT_DIR):

code prompt

Code

import os
import time
OUTPUT_DIR = './output'
def task_func(dataset, filename, output_dir=OUTPUT_DIR):

entry point

task_func

libs

  • os
  • time

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