benchmarks.wiki / Public workspace
BigCodeBench / BigCodeBench v0.1.0_hf 47b2d751-93aa-5b7d-9176-2b7efa4d01d8
Problem
Answer published by the source. Consult the official source to check your work against its answer.
complete prompt
import json
import pandas as pd
def task_func(result, csv_file_path="test.csv", json_file_path="test.json"):
"""
Save the list of dictionaries provided in the 'result' parameter to a CSV file (without index) and a JSON file.
Parameters:
- result (list): A list of dictionaries.
- csv_file_path (str): A path to a CSV file.
- json_file_path (str): A path to a JSON file.
Returns:
None
Requirements:
- pandas
- json
Example:
>>> result = [{"hi": 7, "bye": 4, "from_user": 0}, {1: 2, 3: 4, 5: 6}]
>>> task_func(result, 'test.csv', 'test.json')
"""
instruct prompt
Save the list of dictionaries provided in the 'result' parameter to a CSV file (without index) and a JSON file.
The function should output with:
None
You should write self-contained code starting with:
Code
import json
import pandas as pd
def task_func(result, csv_file_path="test.csv", json_file_path="test.json"):
code prompt
Code
import json
import pandas as pd
def task_func(result, csv_file_path="test.csv", json_file_path="test.json"):
entry point
task_func
libs
- pandas
- json
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
initial import