benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 979589a0-8795-5e12-bc81-3d894187510d

Problem

Answer published by the source. Consult the official source to check your work against its answer.

complete prompt

import numpy as np
import pandas as pd


def task_func(num_teams=5, num_games=100):
    """
    Create a Pandas DataFrame that displays the random scores of different teams in multiple games.
    The function generates random scores for each game played by each team and populates them in
    a DataFrame with index=teams, columns=games.

    Parameters:
    - num_teams (int, optional): The number of teams participating. Default is 5.
    - num_games (int, optional): The number of games played. Default is 100.

    Returns:
    DataFrame: The generated DataFrame containing random scores for each team in each game.

    Requirements:
    - pandas
    - numpy

    Example:
    >>> df = task_func(num_teams=3, num_games=10)
    >>> type(df)
    <class 'pandas.core.frame.DataFrame'>
    """

instruct prompt

Create a Pandas DataFrame that displays the random scores of different teams in multiple games. The function generates random scores for each game played by each team and populates them in a DataFrame with index=teams, columns=games.
The function should output with:
    DataFrame: The generated DataFrame containing random scores for each team in each game.
You should write self-contained code starting with:

Code

import numpy as np
import pandas as pd
def task_func(num_teams=5, num_games=100):

code prompt

Code

import numpy as np
import pandas as pd
def task_func(num_teams=5, num_games=100):

entry point

task_func

libs

  • pandas
  • numpy

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