I was wondering if there is an elegant and shorthand way in Pandas DataFrames to select columns by data type (dtype). i.e. Select only int64 columns from a DataFrame.
<
Optionally if you don't want to create a subset of the dataframe during the process, you can directly iterate through the column datatype.
I haven't benchmarked the code below, assume it will be faster if you work on very large dataset.
[col for col in df.columns.tolist() if df[col].dtype not in ['object','