benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf a116acf5-01c4-5e3e-93e3-7081748d0e12

Problem

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

complete prompt

import math
import pandas as pd

def task_func(tuples_list):
    """
    Given a list of tuples turn them into a Pandas DataFrame with math.sin applied to each number.

    Parameters:
    - tuples_list (list): The list of tuples.
    
    Returns:
    - df (DataFrame): A pandas DataFrame. Each row of df corresponds to a tuple from tuples_list, with the values being the sine of the original values in the tuple.

    Requirements:
    - math
    - pandas

    Example:
    >>> df = task_func([(1, 2, 3, 4), (5, 6, 7, 8), (9, 10, 11, 12)])
    >>> print(df)
              0         1         2         3
    0  0.841471  0.909297  0.141120 -0.756802
    1 -0.958924 -0.279415  0.656987  0.989358
    2  0.412118 -0.544021 -0.999990 -0.536573
    """

instruct prompt

Given a list of tuples turn them into a Pandas DataFrame with math.sin applied to each number.
The function should output with:
    df (DataFrame): A pandas DataFrame. Each row of df corresponds to a tuple from tuples_list, with the values being the sine of the original values in the tuple.
You should write self-contained code starting with:

Code

import math
import pandas as pd
def task_func(tuples_list):

code prompt

Code

import math
import pandas as pd
def task_func(tuples_list):

entry point

task_func

libs

  • math
  • pandas

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