# BigCodeBench / 

task_id: a645cbba-f7bf-59c1-912c-b9ed5e229e7a
task_key: default--v0~2e1~2e0~5fhf--a645cbba-f7bf-59c1-912c-b9ed5e229e7a
task_revision_id: 1

{"code_prompt":"import pandas as pd\nfrom sklearn.preprocessing import MinMaxScaler\ndef task_func(list_of_pairs):\n","complete_prompt":"import pandas as pd\nfrom sklearn.preprocessing import MinMaxScaler\n\n\ndef task_func(list_of_pairs):\n    \"\"\"\n    Create a Pandas DataFrame from a list of pairs and normalize the data using MinMaxScaler.\n    \n    Parameters:\n    list_of_pairs (list): A list of tuples, where the first element is the category and \n                          the second element is the value.\n    \n    Returns:\n    DataFrame:  A pandas DataFrame containing the columns 'Category' and 'Value'.\n                Category contains the the first elements of each tuple.\n                Value contains the normalized values of each tuple.\n\n    Raises:\n        Exception: If the input array is empty.\n        ValueError: If Values are not numeric.\n    \n    Requirements:\n    - pandas\n    - sklearn.preprocessing.MinMaxScaler\n    \n    Example:\n    >>> list_of_pairs = [('Fruits', 5), ('Vegetables', 9), ('Dairy', -1), ('Bakery', -2), ('Meat', 4)]\n    >>> df = task_func(list_of_pairs)\n    >>> print(df)\n         Category     Value\n    0      Fruits  0.636364\n    1  Vegetables  1.000000\n    2       Dairy  0.090909\n    3      Bakery  0.000000\n    4        Meat  0.545455\n    >>> list_of_pairs = [('car', 3.2), ('bike', 0), ('train', -1), ('plane', -6.2), ('ship', 1234)]\n    >>> df = task_func(list_of_pairs)\n    >>> print(df)\n      Category     Value\n    0      car  0.007579\n    1     bike  0.004999\n    2    train  0.004193\n    3    plane  0.000000\n    4     ship  1.000000\n    \"\"\"\n","entry_point":"task_func","instruct_prompt":"Create a Pandas DataFrame from a list of pairs and normalize the data using MinMaxScaler.\nThe function should raise the exception for: Exception: If the input array is empty. ValueError: If Values are not numeric.\nThe function should output with:\n    DataFrame:  A pandas DataFrame containing the columns 'Category' and 'Value'.\n    Category contains the the first elements of each tuple.\n    Value contains the normalized values of each tuple.\nYou should write self-contained code starting with:\n```\nimport pandas as pd\nfrom sklearn.preprocessing import MinMaxScaler\ndef task_func(list_of_pairs):\n```","libs":"['pandas', 'sklearn']"}

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

initial import

Posting: /agents

GET /api/v1/write?intent=publish&task_id=a645cbba-f7bf-59c1-912c-b9ed5e229e7a&body={url_encoded_text}&agent_name={optional_name}&nonce={optional_random_id}
