{"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":"noindex","profile":{"resources":[],"task_format":"","scoring":"","metric":"","size":"","answer_access":"","license":"","citation":"","maintainer":"","released":"","why_hard":"","related":[]}},"task_id":"50e0ee88-f46d-5ca5-8ddb-3ee3208f9ae7","task_key":"default--v0~2e1~2e0~5fhf--50e0ee88-f46d-5ca5-8ddb-3ee3208f9ae7","task_revision_id":"2","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 50e0ee88-f46d-5ca5-8ddb-3ee3208f9ae7","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"from sklearn.cluster import KMeans\\nimport matplotlib.pyplot as plt\\ndef task_func(df, age: int, height: int):\\n\",\"complete_prompt\":\"from sklearn.cluster import KMeans\\nimport matplotlib.pyplot as plt\\n\\n\\ndef task_func(df, age: int, height: int):\\n    \\\"\\\"\\\"\\n    Filters the input DataFrame based on specified 'Age' and 'Height' conditions and applies KMeans clustering.\\n    - If the filtered dataframe has less than 3  columns, add to it a column 'Cluster' with 0 for each row.\\n    - Otherwise, do a KMeans clustering (by Age and Height) with 3 clusters and add a column 'Cluster' to the dataframe which corresponds to the cluster\\n    index of the cluster to which each row belongs to.\\n    - Plot a scatter plot of the 'Age' and 'height' and colored by the cluster indices.\\n    - the xlabel should be 'Age', the ylabel 'Height' and the title 'KMeans Clustering based on Age and Height'.\\n\\n    Parameters:\\n    df (DataFrame): The text to analyze.\\n    age (int): Filter out the rows of the dataframe which 'Age' value is less than or equal to this value.\\n    height (int): Filter out the rows of the dataframe which 'Height' value is greater than or equal to this value.\\n\\n    Returns:\\n    DataFrame: The filtered dataframe with the new column.\\n    matplotlib.axes.Axes: The Axes object of the plotted data. If no KMeans was done, returns None.\\n\\n    Requirements:\\n    - sklearn\\n    - matplotlib\\n\\n    Example:\\n    >>> import pandas as pd\\n    >>> df = pd.DataFrame({\\n    ...     'Age': [30, 45, 60, 75],\\n    ...     'Height': [160, 170, 165, 190],\\n    ...     'Weight': [55, 65, 75, 85]\\n    ... })\\n    >>> selected_df, ax = task_func(df, 50, 180)\\n    >>> print(selected_df)\\n       Age  Height  Weight  Cluster\\n    2   60     165      75        0\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Filters the input DataFrame based on specified 'Age' and 'Height' conditions and applies KMeans clustering. - If the filtered dataframe has less than 3  columns, add to it a column 'Cluster' with 0 for each row. - Otherwise, do a KMeans clustering (by Age and Height) with 3 clusters and add a column 'Cluster' to the dataframe which corresponds to the cluster index of the cluster to which each row belongs to. - Plot a scatter plot of the 'Age' and 'height' and colored by the cluster indices. - the xlabel should be 'Age', the ylabel 'Height' and the title 'KMeans Clustering based on Age and Height'.\\nThe function should output with:\\n    DataFrame: The filtered dataframe with the new column.\\n    matplotlib.axes.Axes: The Axes object of the plotted data. If no KMeans was done, returns None.\\nYou should write self-contained code starting with:\\n```\\nfrom sklearn.cluster import KMeans\\nimport matplotlib.pyplot as plt\\ndef task_func(df, age: int, height: int):\\n```\",\"libs\":\"['matplotlib', 'sklearn']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}