benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 3ce9996a-10ea-5ed8-a322-7039488330c2

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):
    """
    Draw and return a correlation matrix heatmap for a DataFrame containing numerical columns.
    The title of the heatmap is set to 'Correlation Matrix'.
    
    Parameters:
    df (pandas.DataFrame): The DataFrame containing numerical columns to be used for correlation.

    Returns:
    matplotlib.axes._axes.Axes: The matplotlib Axes object representing the heatmap.

    Requirements:
    - pandas
    - seaborn

    Example:
    >>> data = {'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]}
    >>> ax = task_func(data)
    >>> type(ax)
    <class 'matplotlib.axes._axes.Axes'>

    """

instruct prompt

Draw and return a correlation matrix heatmap for a DataFrame containing numerical columns. The title of the heatmap is set to 'Correlation Matrix'.
The function should output with:
    matplotlib.axes._axes.Axes: The matplotlib Axes object representing the heatmap.
You should write self-contained code starting with:

Code

import pandas as pd
import seaborn as sns
def task_func(data):

code prompt

Code

import pandas as pd
import seaborn as sns
def task_func(data):

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