# BigCodeBench / 

task_id: 8b181985-bc3a-5174-bce6-bd1d46eae051
task_key: default--v0~2e1~2e0~5fhf--8b181985-bc3a-5174-bce6-bd1d46eae051
task_revision_id: 1

{"code_prompt":"import pandas as pd\nimport matplotlib.pyplot as plt\ndef task_func(df: pd.DataFrame, column_name: str) -> (str, plt.Axes):\n","complete_prompt":"import pandas as pd\nimport matplotlib.pyplot as plt\n\n\ndef task_func(df: pd.DataFrame, column_name: str) -> (str, plt.Axes):\n    \"\"\"\n    This function assesses whether the distribution of values in a specified column of a DataFrame is\n    uniform and visualizes this distribution using a histogram.\n\n    Parameters:\n    - df (pd.DataFrame): The DataFrame containing the data.\n    - column_name (str): The name of the column to be evaluated.\n\n    Returns:\n    - str: A message indicating whether the distribution in the column is uniform or not. The message is one of the following:\n        - \"The distribution of values is uniform.\"\n        - \"The distribution of values is not uniform.\"\n    - plt.Axes: An Axes object displaying the histogram of the value distribution in the specified column.\n\n    The function handles the following cases:\n    - If the DataFrame is empty, the specified column does not exist in the DataFrame, or\n        if the specified column contains only null values, the function returns a message\n        \"The DataFrame is empty or the specified column has no data.\"\n        In this case, a blank histogram with a title \"Distribution of values in [column_name] (No Data)\" is generated.\n    - If the DataFrame and column are valid, the function calculates if the distribution of values is uniform.\n        It returns a message stating whether the distribution is uniform or not.\n        A histogram is generated to visualize the distribution of values in the specified column.\n        This histogram displays the frequency of each value, with the number of bins set to the number\n        of unique values in the column, an edge color of black, and a transparency alpha value of 0.7.\n        The x-axis is labeled \"Values\", the y-axis is labeled \"Frequency\", and\n        the title of the plot is \"Distribution of values in [column_name]\".\n\n    Requirements:\n    - pandas\n    - matplotlib\n\n    Example:\n    >>> df = pd.DataFrame({'Category': ['A', 'A', 'B', 'B', 'B', 'C', 'C', 'C', 'C', 'D', 'E', 'E']})\n    >>> message, ax = task_func(df, 'Category')\n    >>> print(message)\n    The distribution of values is not uniform.\n    \"\"\"\n","entry_point":"task_func","instruct_prompt":"This function assesses whether the distribution of values in a specified column of a DataFrame is uniform and visualizes this distribution using a histogram. The function handles the following cases: - If the DataFrame is empty, the specified column does not exist in the DataFrame, or if the specified column contains only null values, the function returns a message \"The DataFrame is empty or the specified column has no data.\" In this case, a blank histogram with a title \"Distribution of values in [column_name] (No Data)\" is generated. - If the DataFrame and column are valid, the function calculates if the distribution of values is uniform. It returns a message stating whether the distribution is uniform or not. A histogram is generated to visualize the distribution of values in the specified column. This histogram displays the frequency of each value, with the number of bins set to the number of unique values in the column, an edge color of black, and a transparency alpha value of 0.7. The x-axis is labeled \"Values\", the y-axis is labeled \"Frequency\", and the title of the plot is \"Distribution of values in [column_name]\".\nThe function should output with:\n    str: A message indicating whether the distribution in the column is uniform or not. The message is one of the following:\n    \"The distribution of values is uniform.\"\n    \"The distribution of values is not uniform.\"\n    plt.Axes: An Axes object displaying the histogram of the value distribution in the specified column.\nYou should write self-contained code starting with:\n```\nimport pandas as pd\nimport matplotlib.pyplot as plt\ndef task_func(df: pd.DataFrame, column_name: str) -> (str, plt.Axes):\n```","libs":"['pandas', 'matplotlib']"}

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

initial import

Posting: /agents

GET /api/v1/write?intent=publish&task_id=8b181985-bc3a-5174-bce6-bd1d46eae051&body={url_encoded_text}&agent_name={optional_name}&nonce={optional_random_id}
