{"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":"41092e4d-79bb-55a6-ac85-3abc91e628f4","task_key":"default--v0~2e1~2e0~5fhf--41092e4d-79bb-55a6-ac85-3abc91e628f4","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 41092e4d-79bb-55a6-ac85-3abc91e628f4","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import pandas as pd\\nfrom scipy.stats import chi2_contingency\\ndef task_func(df, columns=['A', 'B', 'C'], larger=50, equal=900):\\n\",\"complete_prompt\":\"import pandas as pd\\nfrom scipy.stats import chi2_contingency\\n\\ndef task_func(df, columns=['A', 'B', 'C'], larger=50, equal=900):\\n    \\\"\\\"\\\"\\n    Filters a pandas DataFrame based on the values of specific rows, and performs\\n    a chi-square independence test on the first two columns.\\n\\n    The function filters rows based on the following criteria:\\n        Keep only rows where:\\n            The value of the second column: df['second'] > larger\\n            and\\n            The value of the third column: df['third'] == equal\\n    \\n    After filtering a conigency table of the first two columns is computed,\\n    which is then used in the chi2 independence test. The p_value of the test\\n    is returned.        \\n\\n    Parameters:\\n    df (pd.DataFrame): A DataFrame containing at least the columns specified in the 'columns' parameter.\\n    columns (list): A list of column names to consider for the operation, defaulting to ['A', 'B', 'C'].\\n                    The first column should contain categorical data, the second numerical data (used for filtering with values > 'larger'),\\n                    and the third numerical data (used for filtering with a fixed value of 'equal').\\n    larger (float, optional): Used for filtering rows against the second column where values > 'larger'.\\n                              Defaults to 50.\\n    equal (float, optional): Used for filtering rows against the third column where values == equal.\\n                             Defaults to 900.\\n\\n    Returns:\\n    float: The p-value from the chi-square independence test, indicating the statistical significance.\\n           \\n    Raises:\\n    ValueError: If there's insufficient data for the test (no rows meeting the criteria).\\n    ValueError: If the number of specified columns is not 3.\\n    ValueError: If the specified columns are not contained in df.\\n    \\n\\n    Requirements:\\n    - pandas\\n    - scipy.stats\\n\\n    Example:\\n    >>> df = pd.DataFrame({\\n    ...     'A': ['Yes', 'No', 'Yes', 'No'],\\n    ...     'B': [55, 70, 40, 85],\\n    ...     'C': [900, 900, 800, 900]\\n    ... })\\n    >>> task_func(df)\\n    0.22313016014842973\\n\\n    >>> df = pd.DataFrame({\\n    ...     'test': ['A', 'b', 'b', 'a', 'c', 'd'],\\n    ...     'hi': [45, 2, 2, 3, 4, 4],\\n    ...     'column3': [50, 50, 50, 50, 50, 50, ]\\n    ... })\\n    >>> task_func(df, ['test', 'hi', 'column3'], larger=2, equal=50)\\n    0.23810330555354436\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Filters a pandas DataFrame based on the values of specific rows, and performs a chi-square independence test on the first two columns. The function filters rows based on the following criteria: Keep only rows where: The value of the second column: df['second'] > larger and The value of the third column: df['third'] == equal After filtering a conigency table of the first two columns is computed, which is then used in the chi2 independence test. The p_value of the test is returned. >>> df = pd.DataFrame({ ...     'test': ['A', 'b', 'b', 'a', 'c', 'd'], ...     'hi': [45, 2, 2, 3, 4, 4], ...     'column3': [50, 50, 50, 50, 50, 50, ] ... }) >>> task_func(df, ['test', 'hi', 'column3'], larger=2, equal=50) 0.23810330555354436\\nThe function should raise the exception for: ValueError: If there's insufficient data for the test (no rows meeting the criteria). ValueError: If the number of specified columns is not 3. ValueError: If the specified columns are not contained in df.\\nThe function should output with:\\n    float: The p-value from the chi-square independence test, indicating the statistical significance.\\nYou should write self-contained code starting with:\\n```\\nimport pandas as pd\\nfrom scipy.stats import chi2_contingency\\ndef task_func(df, columns=['A', 'B', 'C'], larger=50, equal=900):\\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":[]}