{"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":"b57c8aa3-8ba5-5286-8f2b-e4eeafdc2d13","task_key":"default--v0~2e1~2e0~5fhf--b57c8aa3-8ba5-5286-8f2b-e4eeafdc2d13","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf b57c8aa3-8ba5-5286-8f2b-e4eeafdc2d13","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import pandas as pd\\nimport numpy as np\\n# Constants\\nCOLUMNS = ['column1', 'column2', 'column3', 'column4', 'column5']\\ndef task_func(df, dct):\\n\",\"complete_prompt\":\"import pandas as pd\\nimport numpy as np\\n\\n# Constants\\nCOLUMNS = ['column1', 'column2', 'column3', 'column4', 'column5']\\n\\ndef task_func(df, dct):\\n    \\\"\\\"\\\"\\n    Replace certain values in a DataFrame with a dictionary mapping and calculate the Pearson correlation coefficient between each pair of columns.\\n\\n    Parameters:\\n    df (DataFrame): The input DataFrame, containing numeric or categorical data.\\n    dct (dict): A dictionary for replacing values in df, where keys are existing values and values are new values.\\n\\n    Returns:\\n    DataFrame: A DataFrame with the correlation coefficients between each pair of columns. The format of the DataFrame is a square matrix with column and index labels matching the columns of the input DataFrame.\\n    \\n    Requirements:\\n    - pandas\\n    - numpy\\n    \\n    Note:\\n    - This function operates on DataFrames containing numeric or categorical data that can be replaced with numeric values, as correlation calculations require numeric data.\\n    - This function using pearson method to calculate the correlation matrix.\\n    \\n    Raises:\\n    - This function will raise a ValueError is input df is not a DataFrame.\\n        \\n    Example:\\n    >>> df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})\\n    >>> dct = {1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60}\\n    >>> correlation_matrix = task_func(df, dct)\\n    >>> correlation_matrix.shape == (2, 2)\\n    True\\n    >>> np.allclose(correlation_matrix, np.array([[1.0, 1.0], [1.0, 1.0]]))\\n    True\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Replace certain values in a DataFrame with a dictionary mapping and calculate the Pearson correlation coefficient between each pair of columns.\\nNote that: This function operates on DataFrames containing numeric or categorical data that can be replaced with numeric values, as correlation calculations require numeric data. This function using pearson method to calculate the correlation matrix.\\nThe function should raise the exception for: This function will raise a ValueError is input df is not a DataFrame.\\nThe function should output with:\\n    DataFrame: A DataFrame with the correlation coefficients between each pair of columns. The format of the DataFrame is a square matrix with column and index labels matching the columns of the input DataFrame.\\nYou should write self-contained code starting with:\\n```\\nimport pandas as pd\\nimport numpy as np\\n# Constants\\nCOLUMNS = ['column1', 'column2', 'column3', 'column4', 'column5']\\ndef task_func(df, dct):\\n```\",\"libs\":\"['pandas', 'numpy']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}