benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 55efa6ea-144e-5e90-9400-565b1860cebf

Problem

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

complete prompt

import pandas as pd
import time
OUTPUT_DIR = './output'


def task_func(df: pd.DataFrame, filename: str) -> str:
    """
    Write a Pandas DataFrame into a JSON Lines file and save it in a specified directory.

    Parameters:
    - df (pd.DataFrame): A Pandas DataFrame to be saved.
    - filename (str): The filename of the JSON Lines file to be saved.

    Returns:
    - str: The full path where the JSON Lines file was saved.

    Requirements:
    - pandas
    - time

    Example:
    >>> df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
    >>> 'data.jsonl' in task_func(df, 'data.jsonl')
    True
    """

instruct prompt

Write a Pandas DataFrame into a JSON Lines file and save it in a specified directory.
The function should output with:
    str: The full path where the JSON Lines file was saved.
You should write self-contained code starting with:

Code

import pandas as pd
import time
OUTPUT_DIR = './output'
def task_func(df: pd.DataFrame, filename: str) -> str:

code prompt

Code

import pandas as pd
import time
OUTPUT_DIR = './output'
def task_func(df: pd.DataFrame, filename: str) -> str:

entry point

task_func

libs

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