benchmarks.wiki / Public workspace
BigCodeBench / BigCodeBench v0.1.0_hf 603a3d95-3943-5b0d-9ebb-a1c9c7f36e7d
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(df):
"""
Draw and return a heat map with temperature data from a pandas DataFrame.
Parameters:
df (DataFrame): A pandas DataFrame with 'Date', 'Time', and 'Temperature' columns.
Returns:
Axes: Seaborn heatmap object.
Raises:
ValueError: If 'df' is not a DataFrame or lacks 'Date', 'Time', or 'Temperature' columns.
Requirements:
- pandas
- seaborn
- numpy
- matplotlib.pyplot
Example:
>>> np.random.seed(42)
>>> df = pd.DataFrame({
... 'Date': pd.date_range(start='1/1/2021', end='12/31/2021'),
... 'Time': ['12:00']*365,
... 'Temperature': np.random.randint(-10, 35, size=365)
... })
>>> ax = task_func(df)
>>> ax.get_title() # Expected: 'Temperature Heatmap'
'Temperature Heatmap'
"""
instruct prompt
Draw and return a heat map with temperature data from a pandas DataFrame.
The function should raise the exception for: ValueError: If 'df' is not a DataFrame or lacks 'Date', 'Time', or 'Temperature' columns.
The function should output with:
Axes: Seaborn heatmap object.
You should write self-contained code starting with:
Code
import pandas as pd
import seaborn as sns
def task_func(df):
code prompt
Code
import pandas as pd
import seaborn as sns
def task_func(df):
entry point
task_func
libs
- pandas
- 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