Answers for "drop colums whoose value are object type in python"

0

drop colums whoose value are object type in python

import pandas as pd

df = pd.DataFrame({'x': ['a', 'b', 'c'], 'y': [1, 2, 3], 'z': ['d', 'e', 'f']})

df = df.select_dtypes(exclude=['object'])
print(df)
Posted by: Guest on September-21-2020

Python Answers by Framework

Browse Popular Code Answers by Language