INNER CODE UNIT · Python

_delete_unsupported_columns

aeturrell/skimpy · src/skimpy/__init__.py:621

def _delete_unsupported_columns(df: pd.DataFrame) -> pd.DataFrame:
    """This will remove the pd.api.types.infer_dtype types that are not
    supported.

    Args:
        df (pd.DataFrame): Input dataframe.

    Returns:
        pd.DataFrame: Dataframe with unsupported columns removed.

    Raises:
        ValueError: If the input dataframe only has unsupported column types.
    """
    df_types = (
        pd.DataFrame(df.apply(pd.api.types.infer_dtype, axis=0))
        .reset_index()
        .rename(columns={"index": "column", 0: "type"})
    )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…