{"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":"4f4b3cde-4bd8-5c94-892e-12f060c81a4f","task_key":"default--v0~2e1~2e0~5fhf--4f4b3cde-4bd8-5c94-892e-12f060c81a4f","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 4f4b3cde-4bd8-5c94-892e-12f060c81a4f","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import pandas as pd\\nfrom sklearn.preprocessing import LabelEncoder\\ndef task_func(df, dct, columns=None):\\n\",\"complete_prompt\":\"import pandas as pd\\nfrom sklearn.preprocessing import LabelEncoder\\n\\ndef task_func(df, dct, columns=None):\\n    \\\"\\\"\\\"\\n    This function preprocesses a pandas DataFrame by replacing specified values, encoding categorical attributes, \\n    and standardizing numerical attributes. It's designed to be flexible for data preprocessing in machine learning tasks.\\n\\n    Parameters:\\n    - df (DataFrame): The input DataFrame to be preprocessed.\\n    - dct (dict): A dictionary for replacing values in the DataFrame. Keys are existing values, and values are new values.\\n    - columns (list of str, optional): Specific column names to be encoded. If None, all object-type columns in the DataFrame are encoded.\\n\\n    Returns:\\n    - DataFrame: The preprocessed DataFrame with encoded categorical attributes and standardized numerical attributes.\\n\\n    Requirements:\\n    - pandas\\n    - sklearn.preprocessing.LabelEncoder\\n\\n    Example:\\n    >>> df = pd.DataFrame({'col1': ['a', 'b', 'c'], 'col2': [1, 2, 3]})\\n    >>> dct = {'a': 'x', 'b': 'y'}\\n    >>> result = task_func(df, dct)\\n    >>> result.shape == df.shape\\n    True\\n    >>> result['col1'].mean() == 0.0\\n    True\\n\\n    Note:\\n    - The function assumes that the DataFrame and the dictionary are well-formed and relevant to each other.\\n    - The encoding of categorical columns is done using LabelEncoder, which encodes labels with value between 0 and n_classes-1.\\n    - Numerical standardization is performed by subtracting the mean and dividing by the standard deviation of each column.\\n\\n    Raises:\\n    - The function will raise a ValueError is input df is not a DataFrame.\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"This function preprocesses a pandas DataFrame by replacing specified values, encoding categorical attributes, and standardizing numerical attributes. It's designed to be flexible for data preprocessing in machine learning tasks.\\nNote that: The function assumes that the DataFrame and the dictionary are well-formed and relevant to each other. The encoding of categorical columns is done using LabelEncoder, which encodes labels with value between 0 and n_classes-1. Numerical standardization is performed by subtracting the mean and dividing by the standard deviation of each column.\\nThe function should raise the exception for: The function will raise a ValueError is input df is not a DataFrame.\\nThe function should output with:\\n    DataFrame: The preprocessed DataFrame with encoded categorical attributes and standardized numerical attributes.\\nYou should write self-contained code starting with:\\n```\\nimport pandas as pd\\nfrom sklearn.preprocessing import LabelEncoder\\ndef task_func(df, dct, columns=None):\\n```\",\"libs\":\"['pandas', 'sklearn']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}