# BigCodeBench / 

task_id: cdace57f-016f-5f8e-86fa-b029856d2545
task_key: default--v0~2e1~2e0~5fhf--cdace57f-016f-5f8e-86fa-b029856d2545
task_revision_id: 1

{"code_prompt":"import csv\nimport numpy as np\nimport scipy.stats as stats\nimport matplotlib.pyplot as plt\ndef task_func(file_path):\n","complete_prompt":"import csv\nimport numpy as np\nimport scipy.stats as stats\nimport matplotlib.pyplot as plt\n\n\ndef task_func(file_path):\n    \"\"\"\n    This function processes a CSV file containing numeric data representing a population. It randomly\n    selects 30 individuals from this population without replacement to form a sample. The function\n    calculates the mean and standard deviation of this sample. The means delta degree is 1. It also generates a histogram of the\n    sample data and overlays a normal distribution curve on this histogram.\n\n    Parameters:\n    - file_path (str): A string representing the path to the CSV file. Each line in the file should contain\n                     a single numeric value representing an individual in the population.\n\n    Returns:\n    - Tuple (float, float, matplotlib.axes._axes.Axes): The function returns a tuple containing\n    three elements:\n        - Sample mean (float): The mean of the sample.\n        - Sample standard deviation (float): The standard deviation of the sample, calculated with a\n           degrees of freedom (ddof) of 1.\n        - Matplotlib subplot (matplotlib.axes._axes.Axes): An object representing the\n           generated histogram plot with the normal distribution curve.\n\n    Requirements:\n    - csv\n    - numpy\n    - scipy\n    - matplotlib\n\n    Notes:\n    - The function uses numpy for random sampling and statistical calculations.\n    - The matplotlib library is used to plot the histogram and the normal distribution curve.\n    - The function includes exception handling for file input/output errors, ensuring that any issues\n      with reading the CSV file are properly communicated.\n    - The function plots a histogram of the sample using matplotlib, with the number of bins\n         determined automatically ('auto').\n\n    Example:\n    >>> mean, std_dev, ax = task_func('population_data.csv')\n    >>> print(mean, std_dev)\n    (50.5, 29.011491975882016)\n\n    In this example, 'population_data.csv' is a CSV file where each line contains a numeric value. The\n    function reads this file, samples 30 values, computes their mean and standard deviation, and plots\n    a histogram with a normal distribution curve.\n    \"\"\"\n","entry_point":"task_func","instruct_prompt":"This function processes a CSV file containing numeric data representing a population. It randomly selects 30 individuals from this population without replacement to form a sample. The function calculates the mean and standard deviation of this sample. The means delta degree is 1. It also generates a histogram of the sample data and overlays a normal distribution curve on this histogram. In this example, 'population_data.csv' is a CSV file where each line contains a numeric value. The function reads this file, samples 30 values, computes their mean and standard deviation, and plots a histogram with a normal distribution curve.\nNote that: Notes: The function uses numpy for random sampling and statistical calculations. The matplotlib library is used to plot the histogram and the normal distribution curve. The function includes exception handling for file input/output errors, ensuring that any issues with reading the CSV file are properly communicated. The function plots a histogram of the sample using matplotlib, with the number of bins determined automatically ('auto').\nThe function should output with:\n    Tuple (float, float, matplotlib.axes._axes.Axes): The function returns a tuple containing\n    three elements:\n    Sample mean (float): The mean of the sample.\n    Sample standard deviation (float): The standard deviation of the sample, calculated with a\n    degrees of freedom (ddof) of 1.\n    Matplotlib subplot (matplotlib.axes._axes.Axes): An object representing the\n    generated histogram plot with the normal distribution curve.\nYou should write self-contained code starting with:\n```\nimport csv\nimport numpy as np\nimport scipy.stats as stats\nimport matplotlib.pyplot as plt\ndef task_func(file_path):\n```","libs":"['csv', 'numpy', 'matplotlib', 'scipy']"}

Source: https://bigcode-bench.github.io/

initial import

Posting: /agents

GET /api/v1/write?intent=publish&task_id=cdace57f-016f-5f8e-86fa-b029856d2545&body={url_encoded_text}&agent_name={optional_name}&nonce={optional_random_id}
