janitor/utils.py
def _data_checks_pivot_wider(
    df,
    index,
    names_from,
    values_from,
    names_sort,
    flatten_levels,
    values_from_first,
    names_prefix,
    names_sep,
    fill_value,
):

    """
    This function raises errors if the arguments have the wrong
    python type, or if the column does not exist in the dataframe.
    This function is executed before proceeding to the computation phase.
    Type annotations are not provided because this function is where type
    checking happens.
    """

    if index is not None:
        if isinstance(index, str):
            index = [index]
        check("index", index, [list])
        check_column(df, index, present=True)

    if names_from is None:
        raise ValueError(
            "pivot_wider() missing 1 required argument: 'names_from'"
        )

    if names_from is not None:
        if isinstance(names_from, str):
            names_from = [names_from]
        check("names_from", names_from, [list])
        check_column(df, names_from, present=True)

    if values_from is not None:
        check("values_from", values_from, [list, str])
        if isinstance(values_from, str):
            check_column(df, [values_from], present=True)
        else:
            check_column(df, values_from, present=True)

    if values_from_first is not None:
        check("values_from_first", values_from_first, [bool])

    check("names_sort", names_sort, [bool])

    check("flatten_levels", flatten_levels, [bool])

    if names_prefix is not None:
        check("names_prefix", names_prefix, [str])

    if names_sep is not None:
        check("names_sep", names_sep, [str])

    if fill_value is not None:
        check("fill_value", fill_value, [int, float, str])

    return (
        df,
        index,
        names_from,
        values_from,
        names_sort,
        flatten_levels,
        values_from_first,
        names_prefix,
        names_sep,
        fill_value,
    )

    This function raises errors if the arguments have the wrong
    python type, or if the column does not exist in the dataframe.
    This function is executed before proceeding to the computation phase.
    Type annotations are not provided because this function is where type
    checking happens.
    
This function raises errors if the arguments have the wrong
python type, or if the column does not exist in the dataframe.
This function is executed before proceeding to the computation phase.
Type annotations are not provided because this function is where type
checking happens.
This function raises errors if the arguments have the wrong python type or if the column does not exist in the dataframe . This function is executed before proceeding to the computation phase . Type annotations are not provided because this function is where type checking happens .
def _data_checks_pivot_wider(
    df,
    index,
    names_from,
    values_from,
    names_sort,
    flatten_levels,
    values_from_first,
    names_prefix,
    names_sep,
    fill_value,
):
    if index is not None:
        if isinstance(index, str):
            index = [index]
        check("index", index, [list])
        check_column(df, index, present=True)
    if names_from is None:
        raise ValueError(
            "pivot_wider() missing 1 required argument: 'names_from'"
        )
    if names_from is not None:
        if isinstance(names_from, str):
            names_from = [names_from]
        check("names_from", names_from, [list])
        check_column(df, names_from, present=True)
    if values_from is not None:
        check("values_from", values_from, [list, str])
        if isinstance(values_from, str):
            check_column(df, [values_from], present=True)
        else:
            check_column(df, values_from, present=True)
    if values_from_first is not None:
        check("values_from_first", values_from_first, [bool])
    check("names_sort", names_sort, [bool])
    check("flatten_levels", flatten_levels, [bool])
    if names_prefix is not None:
        check("names_prefix", names_prefix, [str])
    if names_sep is not None:
        check("names_sep", names_sep, [str])
    if fill_value is not None:
        check("fill_value", fill_value, [int, float, str])
    return (
        df,
        index,
        names_from,
        values_from,
        names_sort,
        flatten_levels,
        values_from_first,
        names_prefix,
        names_sep,
        fill_value,
    )
def _data_checks_pivot_wider ( df , index , names_from , values_from , names_sort , flatten_levels , values_from_first , names_prefix , names_sep , fill_value , ) : if index is not None : if isinstance ( index , str ) : index = [ index ] check ( "index" , index , [ list ] ) check_column ( df , index , present = True ) if names_from is None : raise ValueError ( "pivot_wider() missing 1 required argument: 'names_from'" ) if names_from is not None : if isinstance ( names_from , str ) : names_from = [ names_from ] check ( "names_from" , names_from , [ list ] ) check_column ( df , names_from , present = True ) if values_from is not None : check ( "values_from" , values_from , [ list , str ] ) if isinstance ( values_from , str ) : check_column ( df , [ values_from ] , present = True ) else : check_column ( df , values_from , present = True ) if values_from_first is not None : check ( "values_from_first" , values_from_first , [ bool ] ) check ( "names_sort" , names_sort , [ bool ] ) check ( "flatten_levels" , flatten_levels , [ bool ] ) if names_prefix is not None : check ( "names_prefix" , names_prefix , [ str ] ) if names_sep is not None : check ( "names_sep" , names_sep , [ str ] ) if fill_value is not None : check ( "fill_value" , fill_value , [ int , float , str ] ) return ( df , index , names_from , values_from , names_sort , flatten_levels , values_from_first , names_prefix , names_sep , fill_value , )
This function raises errors if the arguments have the wrong
python type, or if the column does not exist in the dataframe.
This function raises errors if the arguments have the wrong python type or if the column does not exist in the dataframe .
"""
    This function raises errors if the arguments have the wrong
    python type, or if the column does not exist in the dataframe.
    This function is executed before proceeding to the computation phase.
    Type annotations are not provided because this function is where type
    checking happens.
    """
df
index
names_from
values_from
names_sort
flatten_levels
values_from_first
names_prefix
names_sep
fill_value