benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 14aa29f5-245c-5e82-9015-6bcef07b4209

Problem

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

complete prompt

import pandas as pd
from sklearn.preprocessing import StandardScaler


def task_func(tuples_list, columns):
    """
    Convert a list of tuples into a Pandas DataFrame, perform a default scaling in each column, and return the transformed DataFrame.
    
    Parameters:
    - tuples_list (list): The list of tuples.
    - columns (list): The list of column names.
    
    Returns:
    - df_scaled (DataFrame): A pandas DataFrame containing the scaled versions of the original data.

    Requirements:
    - pandas
    - sklearn
    
    Example:
    >>> df = task_func([(1, 2, 3, 4), (5, 6, 7, 8), (9, 10, 11, 12)], ['A', 'B', 'C', 'D'])
    >>> print(df)
              A         B         C         D
    0 -1.224745 -1.224745 -1.224745 -1.224745
    1  0.000000  0.000000  0.000000  0.000000
    2  1.224745  1.224745  1.224745  1.224745
    """

instruct prompt

Convert a list of tuples into a Pandas DataFrame, perform a default scaling in each column, and return the transformed DataFrame.
The function should output with:
    df_scaled (DataFrame): A pandas DataFrame containing the scaled versions of the original data.
You should write self-contained code starting with:

Code

import pandas as pd
from sklearn.preprocessing import StandardScaler
def task_func(tuples_list, columns):

code prompt

Code

import pandas as pd
from sklearn.preprocessing import StandardScaler
def task_func(tuples_list, columns):

entry point

task_func

libs

  • pandas
  • sklearn

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