benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf d3b90dba-5088-5eb4-8d91-4c1cc1b30fbd

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
import seaborn as sns

def task_func(csv_file_path: str, title: str):
    """
    Create a heatmap of the correlation matrix of a DataFrame built from a CSV file. Round each correlation to 2 decimals.

    Parameters:
    csv_file_path (str): The path to the CSV file containing the input data.
    title (str): The title of the heatmap.

    Returns:
    DataFrame: correlation dataframe where each row and each column correspond to a specific column.
    matplotlib.axes.Axes: The Axes object of the plotted data.

    Requirements:
    - pandas
    - matplotlib.pyplot
    - seaborn

    Example:
    >>> data = "data/task_func/csv_1.csv"
    >>> c, ax = task_func(data, 'Correlation Heatmap')
    """

instruct prompt

Create a heatmap of the correlation matrix of a DataFrame built from a CSV file. Round each correlation to 2 decimals.
The function should output with:
    DataFrame: correlation dataframe where each row and each column correspond to a specific column.
    matplotlib.axes.Axes: The Axes object of the plotted data.
You should write self-contained code starting with:

Code

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def task_func(csv_file_path: str, title: str):

code prompt

Code

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def task_func(csv_file_path: str, title: str):

entry point

task_func

libs

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