Python | Pandas dataframe.select_dtypes() Last Updated : 23 Nov, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas dataframe.select_dtypes() function return a subset of the DataFrame’s columns based on the column dtypes. The parameters of this function can be set to include all the columns having some specific data type or it could be set to exclude all those columns which has some specific data types. 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. For link to the CSV file used in the code, click here Example #1: Use select_dtypes() function to select all the columns which are having floating data types. Python3 # importing pandas as pd import pandas as pd # Creating the dataframe df = pd.read_csv("nba.csv") # Print the dataframe df Let's use the dataframe.select_dtypes() function to select all columns having float data type in the dataframe. Python3 1== # select all columns having float datatype df.select_dtypes(include ='float64') Output : Example #2: Use select_dtypes() function to select all the columns in the dataframe except those columns which are of float data type. Python3 # importing pandas as pd import pandas as pd # Creating the dataframe df = pd.read_csv("nba.csv") # select all columns except float based df.select_dtypes(exclude ='float64') Output : Comment More infoAdvertise with us Next Article Python | Pandas dataframe.select_dtypes() S Shubham__Ranjan Follow Improve Article Tags : Technical Scripter Python Python-pandas Python pandas-dataFrame Pandas-DataFrame-Methods +1 More Practice Tags : python Similar Reads Python | Pandas DataFrame.ftypes Pandas DataFrame is a two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns). Arithmetic operations align on both row and column labels. It can be thought of as a dict-like container for Series objects. This is the primary data structure o 2 min read Python | Pandas DataFrame.values Pandas DataFrame is a two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns). Arithmetic operations align on both row and column labels. It can be thought of as a dict-like container for Series objects. This is the primary data structure o 2 min read Python | Pandas dataframe.get_dtype_counts() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas dataframe.get_dtype_counts() function returns the counts of dtypes in the given 2 min read Python | Pandas Series.dtype Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas series is a One-dimensional ndarray with axis labels. The labels need not be un 2 min read Python | Pandas Index.dtype_str Pandas Index is an immutable ndarray implementing an ordered, sliceable set. It is the basic object which stores the axis labels for all pandas objects. Pandas Index.dtype_str attribute return the data type (dtype) of the underlying data of the given Index object as a string. Syntax: Index.dtype_str 2 min read Like