benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 5ec36b9d-00c7-557e-94e7-dd8c2382a56c

Problem

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

complete prompt

import numpy as np
from scipy import stats


def task_func(df, column, alpha):
    """
    Test the normality of a particular numeric column from a DataFrame with Shapiro-Wilk test, 
    including an artificial step to explicitly use np.

    Parameters:
    - df (pd.DataFrame): The input DataFrame.
    - column (str): The column name.
    - alpha (float): The significance level.

    Returns:
    - bool: True if the column passes the normality test, False otherwise.

    Requirements:
    - numpy
    - scipy.stats
    
    Example:
    >>> import pandas as pd
    >>> np.random.seed(0)
    >>> df = pd.DataFrame({'Value': np.random.normal(0, 1, 1000)})
    >>> print(task_func(df, 'Value', 0.05))
    True
    """

instruct prompt

Test the normality of a particular numeric column from a DataFrame with Shapiro-Wilk test, including an artificial step to explicitly use np.
The function should output with:
    bool: True if the column passes the normality test, False otherwise.
You should write self-contained code starting with:

Code

import numpy as np
from scipy import stats
def task_func(df, column, alpha):

code prompt

Code

import numpy as np
from scipy import stats
def task_func(df, column, alpha):

entry point

task_func

libs

  • numpy
  • scipy

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