benchmarks.wiki / Public workspace
BigCodeBench / BigCodeBench v0.1.0_hf 5cb87aa6-992c-5345-8ac2-c33704fc85df
Problem
Answer published by the source. Consult the official source to check your work against its answer.
complete prompt
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import numpy as np
def task_func(data_url="http://lib.stat.cmu.edu/datasets/boston", seed=42):
"""
Draw the correlation heatmap of the Boston Housing dataset using Seaborn, with an option to save it to a specified file.
Parameters:
seed (int, optional): Random seed for reproducibility. Defaults to 42.
The font should be in the family of sans-serif and Arial.
Returns:
matplotlib.axes.Axes: The Axes object containing the heatmap plot.
Raises:
ValueError: If an error occurs in generating or saving the plot.
Requirements:
- matplotlib
- os
- pandas
- seaborn
- numpy
Example:
>>> ax = task_func()
>>> type(ax)
<class 'matplotlib.axes._axes.Axes'>
"""
instruct prompt
Draw the correlation heatmap of the Boston Housing dataset using Seaborn, with an option to save it to a specified file.
The function should raise the exception for: ValueError: If an error occurs in generating or saving the plot.
The function should output with:
matplotlib.axes.Axes: The Axes object containing the heatmap plot.
You should write self-contained code starting with:
Code
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import numpy as np
def task_func(data_url="http://lib.stat.cmu.edu/datasets/boston", seed=42):
code prompt
Code
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import numpy as np
def task_func(data_url="http://lib.stat.cmu.edu/datasets/boston", seed=42):
entry point
task_func
libs
- pandas
- numpy
- matplotlib
- seaborn
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
initial import