how to get column names having numeric value in pandas 1

how to get column names having numeric value in pandas

cols = df.select_dtypes([np.number]).columns

Here is what the above code is Doing:
1. Selecting all the numeric columns from the dataframe.
2. Creating a list of all the numeric columns.
3. Creating a list of all the non-numeric columns.

Similar Posts