separate categorical from numerical data in python code example Example: how to separate numeric and categorical variables in python df.loc[:,df.dtypes==np.object]