benchmarks.wiki / Public workspace
BigCodeBench / BigCodeBench v0.1.0_hf c1cc4aae-080b-51c7-b2a1-242f00055120
Problem
Answer published by the source. Consult the official source to check your work against its answer.
complete prompt
import ast
import pandas as pd
import seaborn as sns
def task_func(csv_file):
"""
Read a CSV file, convert the string representations of dictionaries in a specific column ('dict_column') to Python dictionaries, and visualize the data with Seaborn's pairplot.
Parameters:
- csv_file (str): The path to the CSV file.
Returns:
tuple: A tuple containing:
- df (DataFrame): The DataFrame after reading and processing the CSV file.
- ax (PairGrid): Seaborn's PairGrid object after plotting.
Requirements:
- ast
- pandas
- seaborn
Example:
>>> df, ax = task_func('data/task_func/csv_1.csv')
>>> type(df)
<class 'pandas.core.frame.DataFrame'>
>>> type(ax)
<class 'seaborn.axisgrid.PairGrid'>
"""
instruct prompt
Read a CSV file, convert the string representations of dictionaries in a specific column ('dict_column') to Python dictionaries, and visualize the data with Seaborn's pairplot.
The function should output with:
tuple: A tuple containing:
df (DataFrame): The DataFrame after reading and processing the CSV file.
ax (PairGrid): Seaborn's PairGrid object after plotting.
You should write self-contained code starting with:
Code
import ast
import pandas as pd
import seaborn as sns
def task_func(csv_file):
code prompt
Code
import ast
import pandas as pd
import seaborn as sns
def task_func(csv_file):
entry point
task_func
libs
- ast
- pandas
- seaborn
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