benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 36ca6869-8c60-5f41-947d-739db6fac7af

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
import numpy as np

# Constants
LABELS = ['H\u2082O', 'O\u2082', 'CO\u2082', 'N\u2082', 'Ar']


def task_func(x, y, labels):
    """
    Create a heatmap using the seaborn library for "x" as x-values and "y" as y-values with labels.

    Parameters:
    x (list): List of numpy arrays representing the x-values of the data points.
    y (list): List of numpy arrays representing the y-values of the data points.
    labels (list): List of strings representing the labels for the chemical compounds.

    Returns:
    ax (Axes): A seaborn heatmap object.
    df (DataFrame): The dataframe used to create the heatmap.

    Requirements:
    - numpy
    - pandas
    - seaborn

    Example:
    >>> x = [np.array([1,2,3]), np.array([4,5,6]), np.array([7,8,9])]
    >>> y = [np.array([4,5,6]), np.array([7,8,9]), np.array([10,11,12])]
    >>> labels = ['H\u2082O', 'O\u2082', 'CO\u2082']
    >>> ax = task_func(x, y, labels)
    """

instruct prompt

Create a heatmap using the seaborn library for "x" as x-values and "y" as y-values with labels.
The function should output with:
    ax (Axes): A seaborn heatmap object.
    df (DataFrame): The dataframe used to create the heatmap.
You should write self-contained code starting with:

Code

import pandas as pd
import seaborn as sns
import numpy as np
# Constants
LABELS = ['H\u2082O', 'O\u2082', 'CO\u2082', 'N\u2082', 'Ar']
def task_func(x, y, labels):

code prompt

Code

import pandas as pd
import seaborn as sns
import numpy as np
# Constants
LABELS = ['H\u2082O', 'O\u2082', 'CO\u2082', 'N\u2082', 'Ar']
def task_func(x, y, labels):

entry point

task_func

libs

  • pandas
  • numpy
  • 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