{"kind":"task","effective_mode":"full","benchmark":{"kind":"benchmark","effective_mode":"full","slug":"bigcodebench","formal_name":"BigCodeBench","introduction":"BigCodeBench poses 1,140 function-level tasks drawn across 139 libraries. It tests whether a model can compose several real APIs correctly rather than write one self-contained function.","introduction_ja":"","introduction_en":"","category":"Category not supplied","task_count":null,"acquisition_status":"Acquisition status not supplied","official_url":"https://bigcode-bench.github.io/","indexing_mode":"index","profile":{"resources":[],"task_format":"","scoring":"","metric":"","size":"","answer_access":"","license":"","citation":"","maintainer":"","released":"","why_hard":"","related":[],"history":"","construction":"","limitations":"","saturation":"","scores":[]}},"task_id":"d5c6801b-2ba3-5377-9802-5c405ea0c8ac","task_key":"default--v0~2e1~2e0~5fhf--d5c6801b-2ba3-5377-9802-5c405ea0c8ac","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf d5c6801b-2ba3-5377-9802-5c405ea0c8ac","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import numpy as np\\nfrom scipy import stats\\n# Constants\\nFEATURES = ['feature1', 'feature2', 'feature3', 'feature4', 'feature5']\\ndef task_func(df, dct):\\n\",\"complete_prompt\":\"import numpy as np\\nfrom scipy import stats\\n\\n# Constants\\nFEATURES = ['feature1', 'feature2', 'feature3', 'feature4', 'feature5']\\n\\ndef task_func(df, dct):\\n    \\\"\\\"\\\"\\n    This function calculates and returns the mean, median, mode, and variance for specified features in a DataFrame. \\n    It replaces certain values in the DataFrame based on a provided dictionary mapping before performing the calculations.\\n    \\n    Parameters:\\n    df (DataFrame): The input DataFrame.\\n    dct (dict): A dictionary for replacing values in df.\\n    \\n    Returns:\\n    dict: A dictionary containing statistics (mean, median, mode, variance) for each feature defined in the 'FEATURES' constant.\\n    \\n    Requirements:\\n    - numpy\\n    - scipy.stats\\n\\n    Note:\\n    - The function would return \\\"Invalid input\\\" string if the input is invalid (e.g., does not contain the required 'feature1' key) or if there is an error in the calculation.\\n    \\n    Example:\\n    >>> df = pd.DataFrame({'feature1': [1, 2, 3, 4, 5], 'feature2': [5, 4, 3, 2, 1], 'feature3': [2, 2, 2, 2, 2], 'feature4': [1, 1, 3, 3, 5], 'feature5': [0, 1, 1, 1, 1]})\\n    >>> dct = {}\\n    >>> task_func(df, dct)\\n    {'feature1': {'mean': 3.0, 'median': 3.0, 'mode': 1, 'variance': 2.0}, 'feature2': {'mean': 3.0, 'median': 3.0, 'mode': 1, 'variance': 2.0}, 'feature3': {'mean': 2.0, 'median': 2.0, 'mode': 2, 'variance': 0.0}, 'feature4': {'mean': 2.6, 'median': 3.0, 'mode': 1, 'variance': 2.24}, 'feature5': {'mean': 0.8, 'median': 1.0, 'mode': 1, 'variance': 0.16000000000000006}}\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"This function calculates and returns the mean, median, mode, and variance for specified features in a DataFrame. It replaces certain values in the DataFrame based on a provided dictionary mapping before performing the calculations.\\nNote that: The function would return \\\"Invalid input\\\" string if the input is invalid (e.g., does not contain the required 'feature1' key) or if there is an error in the calculation.\\nThe function should output with:\\n    dict: A dictionary containing statistics (mean, median, mode, variance) for each feature defined in the 'FEATURES' constant.\\nYou should write self-contained code starting with:\\n```\\nimport numpy as np\\nfrom scipy import stats\\n# Constants\\nFEATURES = ['feature1', 'feature2', 'feature3', 'feature4', 'feature5']\\ndef task_func(df, dct):\\n```\",\"libs\":\"['numpy', 'scipy']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}