예제 #1
0
def cast_to_detected(data: Sequence, typeset: VisionsTypeset) -> Sequence:
    """Casts a DataFrame into a typeset by first performing column wise type detection against
    a provided typeset

    Args:
        data: the DataFrame to cast
        typeset: the Typeset in which we cast

    Returns:
        A tuple of the casted DataFrame and the types to which the columns were cast
    """
    return typeset.cast_to_detected(data)
예제 #2
0
def cast_to_detected(data: Union[pd.Series, pd.DataFrame],
                     typeset: VisionsTypeset) -> pd.DataFrame:
    """Casts a DataFrame into a typeset by first performing column wise type inference against
    a provided typeset

    Args:
        df: the DataFrame to cast
        typeset: the Typeset in which we cast

    Returns:
        A tuple of the casted DataFrame and the types to which the columns were cast
    """
    return typeset.cast_to_detected(data)