{"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":"41e559ed-4d21-5589-9623-a5330a018a20","task_key":"default--v0~2e1~2e0~5fhf--41e559ed-4d21-5589-9623-a5330a018a20","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 41e559ed-4d21-5589-9623-a5330a018a20","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import pandas as pd\\nfrom scipy.stats import pearsonr\\ndef task_func(data):\\n\",\"complete_prompt\":\"import pandas as pd\\nfrom scipy.stats import pearsonr\\n\\n\\ndef task_func(data):\\n    \\\"\\\"\\\"\\n    Calculates the Pearson correlation coefficient between numerical scores and categorical grades.\\n\\n    This function performs three main tasks:\\n    1. Converts scores from string format to floats.\\n    2. Encodes categorical grades into numerical values based on their rank order.\\n    3. Computes the Pearson correlation coefficient between the numerical scores and the encoded grades.\\n\\n    Parameters:\\n    - data (dict): A dictionary containing two keys:\\n                 - 'Score_String': A list of scores in string format.\\n                 - 'Grade': A list of corresponding grades in string format.\\n                 Each list under these keys must have the same length.\\n\\n    Returns:\\n    - correlation (float): The Pearson correlation coefficient between the converted numerical scores and encoded grades.\\n           Returns NaN if the input data frame has less than 2 rows, as the correlation coefficient cannot be calculated in this case.\\n\\n    Requirements:\\n    - pandas\\n    - scipy\\n\\n    Example:\\n    >>> round(task_func({'Score_String': ['80.5', '85.7', '90.2'], 'Grade': ['B', 'B+', 'A-']}),2)\\n    -0.46\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Calculates the Pearson correlation coefficient between numerical scores and categorical grades. This function performs three main tasks: 1. Converts scores from string format to floats. 2. Encodes categorical grades into numerical values based on their rank order. 3. Computes the Pearson correlation coefficient between the numerical scores and the encoded grades.\\nThe function should output with:\\n    correlation (float): The Pearson correlation coefficient between the converted numerical scores and encoded grades.\\n    Returns NaN if the input data frame has less than 2 rows, as the correlation coefficient cannot be calculated in this case.\\nYou should write self-contained code starting with:\\n```\\nimport pandas as pd\\nfrom scipy.stats import pearsonr\\ndef task_func(data):\\n```\",\"libs\":\"['pandas', 'scipy']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}