Select Columns with Specific Data Types in Pandas Dataframe Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In this article, we will see how to select columns with specific data types from a dataframe. This operation can be performed using the DataFrame.select_dtypes() method in pandas module. Syntax: DataFrame.select_dtypes(include=None, exclude=None)Parameters : include, exclude : A selection of dtypes or strings to be included/excluded. At least one of these parameters must be supplied.Return : The subset of the frame including the dtypes in include and excluding the dtypes in exclude. Step-by-step Approach: First, import modules then load the dataset. Python3 # import required module import pandas as pd # assign dataset df = pd.read_csv("train.csv") Then we will find types of data present in our dataset using dataframe.info() method. Python3 # display description # of the dataset df.info() Output: Now, we will use DataFrame.select_dtypes() to select a specific datatype. Python3 # store columns with specific data type integer_columns = df.select_dtypes(include=['int64']).columns float_columns = df.select_dtypes(include=['float64']).columns object_columns = df.select_dtypes(include=['object']).columns Finally, display the column having a particular data type. Python3 # display columns print('\nint64 columns:\n', integer_columns) print('\nfloat64 columns:\n', float_columns) print('\nobject columns:\n', object_columns) Output: Below is the complete program based on the above approach: Python3 # import required module import pandas as pd # assign dataset df = pd.read_csv("train.csv") # store columns with specific data type integer_columns = df.select_dtypes(include=['int64']).columns float_columns = df.select_dtypes(include=['float64']).columns object_columns = df.select_dtypes(include=['object']).columns # display columns print('\nint64 columns:\n',integer_columns) print('\nfloat64 columns:\n',float_columns) print('\nobject columns:\n',object_columns) Output: Example: Here we are going to extract columns of the below dataset: Python3 # import required module import pandas as pd from vega_datasets import data # assign dataset df = data.seattle_weather() # display dataset df.sample(10) Output: Now, we are going to display all the columns having float64 as the data type. Python3 # import required module import pandas as pd from vega_datasets import data # assign dataset df = data.seattle_weather() # display description # of dataset df.info() # store columns with specific data type columns = df.select_dtypes(include=['float64']).columns # display columns print('\nColumns:\n', columns) Output: Create Quiz Comment I incredeble Follow 0 Improve I incredeble Follow 0 Improve Article Tags : Python Python-pandas Python pandas-dataFrame Python Pandas-exercise Explore Python FundamentalsPython Introduction 2 min read Input and Output in Python 4 min read Python Variables 4 min read Python Operators 4 min read Python Keywords 2 min read Python Data Types 8 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 5 min read Python Functions 5 min read Recursion in Python 4 min read Python Lambda Functions 5 min read Python Data StructuresPython String 5 min read Python Lists 4 min read Python Tuples 4 min read Python Dictionary 3 min read Python Sets 6 min read Python Arrays 7 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 5 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 3 min read Python MySQL 9 min read Python Packages 10 min read Python Modules 3 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 3 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 4 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 3 min read StatsModel Library - Tutorial 3 min read Learning Model Building in Scikit-learn 6 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 6 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 7 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 5 min read Build a REST API using Flask - Python 3 min read Building a Simple API with Django REST Framework 3 min read Python PracticePython Quiz 1 min read Python Coding Practice 1 min read Python Interview Questions and Answers 15+ min read Like