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