예제 #1
0
def infer_type(data: Sequence,
               typeset: VisionsTypeset) -> Union[Dict[str, T], T]:
    """Infer the current types of each column in the DataFrame given the typeset.

    Args:
        data: the DataFrame to infer types on
        typeset: the Typeset that provides the type context

    Returns:
        A dictionary with a mapping from column name to type
    """
    return typeset.infer_type(data)
예제 #2
0
def infer_type(
    data: Union[pd.Series, pd.DataFrame], typeset: VisionsTypeset
) -> Union[Dict[str, Type[VisionsBaseType]], Type[VisionsBaseType]]:
    """Infer the current types of each column in the DataFrame given the typeset.

    Args:
        df: the DataFrame to infer types on
        typeset: the Typeset that provides the type context

    Returns:
        A dictionary with a mapping from column name to type
    """
    return typeset.infer_type(data)