benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 1dcad973-8098-503a-8126-f8c8fa0786be

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(data_dict):
    """
    Generates histograms for each column in the given DataFrame and checks if the value distributions
    are uniform. It prints a message for each non-uniform distribution.

    Parameters:
    df (pd.DataFrame): The DataFrame to be analyzed.

    Returns:
    List[plt.Axes]: A list of matplotlib Axes objects, each representing the histogram for a column.
    
    Requirements:
    - pandas
    - matplotlib.pyplot

    Example:
    >>> data = {'Category1': ['A', 'A', 'B', 'B', 'B', 'C', 'C', 'C', 'C', 'D', 'E', 'E'],
    ...                    'Category2': ['X', 'Y', 'Y', 'Z', 'Z', 'Z', 'Z', 'W', 'W', 'W', 'W', 'W']}
    >>> axes = task_func(data)
    The distribution of values in column 'Category1' is not uniform.
    The distribution of values in column 'Category2' is not uniform.
    >>> [ax.get_title() for ax in axes]
    ['Category1', 'Category2']
    """

instruct prompt

Generates histograms for each column in the given DataFrame and checks if the value distributions are uniform. It prints a message for each non-uniform distribution.
The function should output with:
    List[plt.Axes]: A list of matplotlib Axes objects, each representing the histogram for a column.
You should write self-contained code starting with:

Code

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

code prompt

Code

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

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