benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 2c2435e0-afab-5942-addd-2394016ecb12

Problem

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

complete prompt

import pandas as pd
from scipy.stats import skew

def task_func(df):
    """
    Calculate the skewness of the last column of the dataframe.

    Parameters:
    df (DataFrame): The input dataframe.

    Returns:
    float: The skewness of the last column of the dataframe.

    Raises:
    ValueError: If the input is not a DataFrame or has no columns.

    Requirements:
    - pandas
    - scipy.stats
    
    Example:
    >>> df = pd.DataFrame(np.random.randint(0,100,size=(100, 4)), columns=list('ABCD'))
    >>> skewness = task_func(df)
    """

instruct prompt

Calculate the skewness of the last column of the dataframe.
The function should raise the exception for: ValueError: If the input is not a DataFrame or has no columns.
The function should output with:
    float: The skewness of the last column of the dataframe.
You should write self-contained code starting with:

Code

import pandas as pd
from scipy.stats import skew
def task_func(df):

code prompt

Code

import pandas as pd
from scipy.stats import skew
def task_func(df):

entry point

task_func

libs

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