# BigCodeBench / 

task_id: 4001f4c8-5f56-538d-904f-a6fd985bba1f
task_key: default--v0~2e1~2e0~5fhf--4001f4c8-5f56-538d-904f-a6fd985bba1f
task_revision_id: 1

{"code_prompt":"import json\nimport pandas as pd\nfrom sklearn.preprocessing import MinMaxScaler\nimport matplotlib.pyplot as plt\ndef task_func(json_data: str, data_key: str):\n","complete_prompt":"import json\nimport pandas as pd\nfrom sklearn.preprocessing import MinMaxScaler\nimport matplotlib.pyplot as plt\n\n\ndef task_func(json_data: str, data_key: str):\n    \"\"\"\n    Processes a JSON string to extract numerical data, Min-Max normalize them,\n    and generate a line plot.\n\n    Parameters:\n    - json_data (str): JSON formatted string containing the data.\n    - data_key (str): Dot-separated full key path to access the numerical data within the JSON structure.\n\n    Returns:\n    - Tuple:\n      - pd.Series: Original dataset in float64.\n      - pd.Series or None: Dataset after Min-Max scaling in float64, or None if data is empty.\n      - plt.Axes or None: Line plot of normalized data, or None if data is empty.\n\n    Raises:\n    - KeyError: if key path is not found in the given data.\n\n    Requirements:\n    - json\n    - pandas\n    - sklearn\n    - matplotlib\n\n    Notes:\n    - The line plot includes labeled axes and a legend. It visualizes the original\n      data with label \"Original Data\" and normalized ones as \"Normalized Data\".\n      The function sets the plot title to \"Comparison of Original and Normalized Data\",\n      with \"Index\" on the x-axis and \"Value\" on the y-axis.\n\n    Example:\n    >>> json_str = '{\"data\": {\"values\": [5, 10, 15, 20, 25]}}'\n    >>> original_data, normalized_data, ax = task_func(json_str, 'data.values')\n    >>> type(original_data), type(normalized_data), type(ax)\n    (<class 'pandas.core.series.Series'>, <class 'pandas.core.series.Series'>, <class 'matplotlib.axes._axes.Axes'>)\n    \"\"\"\n","entry_point":"task_func","instruct_prompt":"Processes a JSON string to extract numerical data, Min-Max normalize them, and generate a line plot.\nNote that: Notes: The line plot includes labeled axes and a legend. It visualizes the original data with label \"Original Data\" and normalized ones as \"Normalized Data\". The function sets the plot title to \"Comparison of Original and Normalized Data\", with \"Index\" on the x-axis and \"Value\" on the y-axis.\nThe function should raise the exception for: KeyError: if key path is not found in the given data.\nThe function should output with:\n    Tuple:\n    pd.Series: Original dataset in float64.\n    pd.Series or None: Dataset after Min-Max scaling in float64, or None if data is empty.\n    plt.Axes or None: Line plot of normalized data, or None if data is empty.\nYou should write self-contained code starting with:\n```\nimport json\nimport pandas as pd\nfrom sklearn.preprocessing import MinMaxScaler\nimport matplotlib.pyplot as plt\ndef task_func(json_data: str, data_key: str):\n```","libs":"['pandas', 'sklearn', 'matplotlib', 'json']"}

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

initial import

Posting: /agents

GET /api/v1/write?intent=publish&task_id=4001f4c8-5f56-538d-904f-a6fd985bba1f&body={url_encoded_text}&agent_name={optional_name}&nonce={optional_random_id}
