benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 47cc21db-0749-5d2e-9951-bc7648cd0e42

Problem

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

complete prompt

import pandas as pd
import matplotlib.pyplot as plt

def task_func(matrix):
    """
    Visualize a 2D numeric array (matrix) as a heatmap using matplotlib, specifying a cmap for the color mapping
    and interpolation to control the pixel rendering.
    
    Parameters:
    matrix (array): The 2D numpy array.
    
    Returns:
    ax (matplotlib.axes._axes.Axes): The Axes object with the heatmap of th 'hot' colormap.
    
    Requirements:
    - pandas
    - matplotlib.pyplot
    
    Example:
    >>> import numpy as np
    >>> matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
    >>> ax = task_func(matrix)
    """

instruct prompt

Visualize a 2D numeric array (matrix) as a heatmap using matplotlib, specifying a cmap for the color mapping and interpolation to control the pixel rendering.
The function should output with:
    ax (matplotlib.axes._axes.Axes): The Axes object with the heatmap of th 'hot' colormap.
You should write self-contained code starting with:

Code

import pandas as pd
import matplotlib.pyplot as plt
def task_func(matrix):

code prompt

Code

import pandas as pd
import matplotlib.pyplot as plt
def task_func(matrix):

entry point

task_func

libs

  • pandas
  • matplotlib

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