0

How do we select the columns which have numeric values of all the columns present in a data frame?
We can select the required columns by using the column name and then by slicing those columns from the data frame, but how do we extract those columns using the data type that is present in it

Debi Prasad
  • 297
  • 1
  • 8

1 Answers1

1

let's imagine you already have a dataframe df

df with only numerical data is

import pandas as pd
import numpy as np


df_numeric = df.select_dtypes(include=np.number)
pacdev
  • 551
  • 1
  • 3
  • 13