drop colums whoose value are object type in python

Solutions on MaxInterview for drop colums whoose value are object type in python by the best coders in the world

showing results for - "drop colums whoose value are object type in python"
Giada
09 Apr 2020
1import pandas as pd
2
3df = pd.DataFrame({'x': ['a', 'b', 'c'], 'y': [1, 2, 3], 'z': ['d', 'e', 'f']})
4
5df = df.select_dtypes(exclude=['object'])
6print(df)