benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf d249055c-8387-59ba-a369-0bc1dd791321

Problem

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

complete prompt

import pandas as pd
import json


def task_func(file_path, key):
    """
    Load a JSON file into a Pandas DataFrame, remove a specific key from each object and write the processed DataFrame back into a JSON file oriented by records.
    
    Parameters:
    - file_path (str): The path to the JSON file.
    - key (str): The key to remove from each object.
    
    Returns:
    - df (DataFrame): A pandas DataFrame representation of the processed JSON data.

    Requirements:
    - pandas
    - json
    
    Example:
    >>> df = task_func('data.json', 'ele')
    """

instruct prompt

Load a JSON file into a Pandas DataFrame, remove a specific key from each object and write the processed DataFrame back into a JSON file oriented by records.
The function should output with:
    df (DataFrame): A pandas DataFrame representation of the processed JSON data.
You should write self-contained code starting with:

Code

import pandas as pd
import json
def task_func(file_path, key):

code prompt

Code

import pandas as pd
import json
def task_func(file_path, key):

entry point

task_func

libs

  • pandas
  • json

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