benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 8dc63604-18b5-5324-99b2-5953e51e30f5

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(array):
    """
    Create a Pandas DataFrame from a 2D list and plot the sum of each column.

    Parameters:
    array (list of list of int): The 2D list representing the data.

    Returns:
    DataFrame, Axes: A pandas DataFrame with the data and a matplotlib Axes object showing the sum of each column.

    Requirements:
    - pandas
    - matplotlib.pyplot

    Internal Constants:
    COLUMNS: List of column names used for the DataFrame ['A', 'B', 'C', 'D', 'E']

    Example:
    >>> df, ax = task_func([[1,2,3,4,5], [6,7,8,9,10]])
    >>> print(df)
       A  B  C  D   E
    0  1  2  3  4   5
    1  6  7  8  9  10
    >>> type(ax)
    <class 'matplotlib.axes._axes.Axes'>
    """

instruct prompt

Create a Pandas DataFrame from a 2D list and plot the sum of each column. Internal Constants: COLUMNS: List of column names used for the DataFrame ['A', 'B', 'C', 'D', 'E']
The function should output with:
    DataFrame, Axes: A pandas DataFrame with the data and a matplotlib Axes object showing the sum of each column.
You should write self-contained code starting with:

Code

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

code prompt

Code

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

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