benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf c2202bff-ca83-5e7f-b459-553b9642577e

Problem

Answer published by the source. Consult the official source to check your work against its answer.

complete prompt

import pandas as pd
import seaborn as sns


def task_func(data, column="c"):
    """
    Removes a column from a given data dictionary and creates a heatmap
    of the correlation matrix of the remaining data. Non-numeric columns are
    excluded from the heatmap. If the data is empty or has no numeric columns,
    the function returns None.

    Parameters:
    - data: The input data dictionary.
    - column (str): Name of column to remove. Defaults to "c".

    Returns:
    - matplotlib.axes._axes.Axes or None: The Axes object of the heatmap
      or None if the heatmap is not generated.

    Requirements:
    - pandas
    - seaborn

    Example:
    >>> task_func({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]})
    <Axes: >
    >>> task_func(pd.DataFrame({'a': ["foo", "bar"]}))
    """

instruct prompt

Removes a column from a given data dictionary and creates a heatmap of the correlation matrix of the remaining data. Non-numeric columns are excluded from the heatmap. If the data is empty or has no numeric columns, the function returns None.
The function should output with:
    matplotlib.axes._axes.Axes or None: The Axes object of the heatmap
    or None if the heatmap is not generated.
You should write self-contained code starting with:

Code

import pandas as pd
import seaborn as sns
def task_func(data, column="c"):

code prompt

Code

import pandas as pd
import seaborn as sns
def task_func(data, column="c"):

entry point

task_func

libs

  • pandas
  • seaborn

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import