benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 46683eb6-a998-511e-9701-48e9703a7212

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 numpy as np

def task_func(myList):
    """
    Normalize a list of numeric values to the range [0, 1] using min-max scaling.

    Parameters:
    - myList (list): List of numerical values to normalize.

    Returns:
    - ndarray: An array of normalized values.

    Requirements:
    - sklearn.preprocessing.MinMaxScaler
    - numpy

    Example:
    >>> myList = [10, 20, 30, 40, 50]
    >>> task_func(myList)
    array([0.  , 0.25, 0.5 , 0.75, 1.  ])
    """

instruct prompt

Normalize a list of numeric values to the range [0, 1] using min-max scaling.
The function should output with:
    ndarray: An array of normalized values.
You should write self-contained code starting with:

Code

from sklearn.preprocessing import MinMaxScaler
import numpy as np
def task_func(myList):

code prompt

Code

from sklearn.preprocessing import MinMaxScaler
import numpy as np
def task_func(myList):

entry point

task_func

libs

  • numpy
  • 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