Answers for "how to check mix types in pandas column"

0

how to check mix types in pandas column

if mixed_dtypes := {c: dtype for c in df.columns if (dtype := pd.api.types.infer_dtype(df[c])).startswith("mixed")}:
    raise TypeError(f"Dataframe has one more mixed dtypes: {mixed_dtypes}")
Posted by: Guest on November-27-2020

Code answers related to "how to check mix types in pandas column"

Python Answers by Framework

Browse Popular Code Answers by Language