benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf b29b4e29-8d5a-566b-a0b4-59ae1dc1b3bc

Problem

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

complete prompt

from sklearn.preprocessing import StandardScaler
import numpy as np
import base64

def task_func(data):
    """
    Standardize a numeric array using sklearn's StandardScaler and encode the standardized data in base64 format as an ASCII string.
    
    Parameters:
    - data (numpy.ndarray): The numpy array to standardize and encode.
    
    Returns:
    - str: The base64-encoded ASCII string representation of the standardized data.
    
    Requirements:
    - sklearn.preprocessing.StandardScaler
    - numpy
    - base64
    
    Example:
    >>> data = np.array([[0, 0], [0, 0], [1, 1], [1, 1]])
    >>> encoded_data = task_func(data)
    >>> print(encoded_data)
    W1stMS4gLTEuXQogWy0xLiAtMS5dCiBbIDEuICAxLl0KIFsgMS4gIDEuXV0=
    """

instruct prompt

Standardize a numeric array using sklearn's StandardScaler and encode the standardized data in base64 format as an ASCII string.
The function should output with:
    str: The base64-encoded ASCII string representation of the standardized data.
You should write self-contained code starting with:

Code

from sklearn.preprocessing import StandardScaler
import numpy as np
import base64
def task_func(data):

code prompt

Code

from sklearn.preprocessing import StandardScaler
import numpy as np
import base64
def task_func(data):

entry point

task_func

libs

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