benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 5b61b2eb-534e-5b4a-9894-4e9d22ccc539

Problem

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

complete prompt

from sklearn.preprocessing import MinMaxScaler
import pandas as pd

def task_func(l):
    """
    Scale the input field to the range [0, 1] and display it as a DataFrame.

    Parameters:
    l (numpy array): The input array.

    Returns:
    DataFrame: A pandas DataFrame of the scaled array.

    Requirements:
    - numpy
    - sklearn.preprocessing
    - pandas

    Note:
    - The return DataFrame use 'Scaled Values' as the column name.

    Example:
    >>> import numpy as np
    >>> l = np.array([10, 20, 30, 40, 50])
    >>> df = task_func(l)
    >>> print(int(df.iloc[0]['Scaled Values']))
    0
    """

instruct prompt

Scale the input field to the range [0, 1] and display it as a DataFrame.
Note that: The return DataFrame use 'Scaled Values' as the column name.
The function should output with:
    DataFrame: A pandas DataFrame of the scaled array.
You should write self-contained code starting with:

Code

from sklearn.preprocessing import MinMaxScaler
import pandas as pd
def task_func(l):

code prompt

Code

from sklearn.preprocessing import MinMaxScaler
import pandas as pd
def task_func(l):

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