benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf f207f56a-39e9-5db9-9d9a-cbcbc176e3be

Problem

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

complete prompt

import numpy as np
from sklearn.preprocessing import MinMaxScaler

# Constants
ARRAY_LENGTH = 10

def task_func():
    """
    Generate a random array and apply min-max normalization (scaling) to transform the array values into a range between 0 and 1.

    Parameters:
    - None

    Returns:
    - scaled_array (numpy.ndarray): The normalized array.

    Requirements:
    - numpy
    - sklearn

    Example:
    >>> task_func()
    array([[0.57142857],
           [0.14285714],
           [0.71428571],
           [0.28571429],
           [0.57142857],
           [1.        ],
           [0.        ],
           [0.57142857],
           [0.71428571],
           [0.28571429]])
    """

instruct prompt

Generate a random array and apply min-max normalization (scaling) to transform the array values into a range between 0 and 1.
The function should output with:
    scaled_array (numpy.ndarray): The normalized array.
You should write self-contained code starting with:

Code

import numpy as np
from sklearn.preprocessing import MinMaxScaler
# Constants
ARRAY_LENGTH = 10
def task_func():

code prompt

Code

import numpy as np
from sklearn.preprocessing import MinMaxScaler
# Constants
ARRAY_LENGTH = 10
def task_func():

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