benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf d64cf892-52a1-5942-8a6a-ba0d164e29fe

Problem

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

complete prompt

import pandas as pd
import seaborn as sns
import numpy as np
import ast

def task_func(csv_file):
    """
    Load e-mail data from a CSV file, convert it into a Pandas DataFrame, and calculate the sum, mean, and standard deviation of the list associated with each e-mail. Additionally, this function will
    draw a histogram of the mean values and return both the DataFrame and the histogram plot.

    Parameters:
    - csv_file (str): The path to the CSV file containing email data.

    Returns:
    - tuple: A tuple containing two elements:
        - DataFrame: A pandas DataFrame with columns 'email', 'list', 'sum', 'mean', and 'std'.
        - Axes: A histogram plot of the mean values.

    Requirements:
    - pandas
    - seaborn
    - numpy
    - ast

    Example:
    >>> df, plot = task_func('data/task_func/csv_1.csv')
    >>> print(df.head())
    >>> print(type(plot))
    """

instruct prompt

Load e-mail data from a CSV file, convert it into a Pandas DataFrame, and calculate the sum, mean, and standard deviation of the list associated with each e-mail. Additionally, this function will draw a histogram of the mean values and return both the DataFrame and the histogram plot.
The function should output with:
    tuple: A tuple containing two elements:
    DataFrame: A pandas DataFrame with columns 'email', 'list', 'sum', 'mean', and 'std'.
    Axes: A histogram plot of the mean values.
You should write self-contained code starting with:

Code

import pandas as pd
import seaborn as sns
import numpy as np
import ast
def task_func(csv_file):

code prompt

Code

import pandas as pd
import seaborn as sns
import numpy as np
import ast
def task_func(csv_file):

entry point

task_func

libs

  • ast
  • pandas
  • numpy
  • seaborn

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