isin check on column datatypes returning false

32 Views Asked by At

I have a dataframe which prints the following information when info() method is called: Output of info on dataframe

When i run the following line to identify columns with int and float data types,

discrete_features = X_train.dtypes.isin([int, float]) print(f"Discrete Features: {discrete_features}" )

i get the following output:

Discrete Features: id False gravity False ph False osmo False cond False urea False calc False dtype: bool

Even if i try with the below modified line, i still get the same output. discrete_features = X_train.dtypes.isin([np.int32, np.float32])

why are the column datatypes not getting properly identified

Expecting discrete_columns to have names of all columns with int and float type to be correctly identified as True

0

There are 0 best solutions below