Python | Pandas dataframe.equals() Last Updated : 20 Nov, 2018 Comments Improve Suggest changes 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.equals() function is used to determine if two dataframe object in consideration are equal or not. Unlike dataframe.eq() method, the result of the operation is a scalar boolean value indicating if the dataframe objects are equal or not. Syntax: DataFrame.equals(other) Parameters: other : DataFrame Returns: Scalar : boolean value Example #1: Use equals() function to find the result of comparison between two different dataframe objects. Python3 # importing pandas as pd import pandas as pd # Creating the first dataframe df1 = pd.DataFrame({"A":[1,5,7,8], "B":[5,8,4,3], "C":[10,4,9,3]}) # Creating the second dataframe df2 = pd.DataFrame({"A":[5,3,6,4], "B":[11,2,4,3], "C":[4,3,8,5]}) # Print the first dataframe df1 # Print the second dataframe df2 Let's find the result of comparison between both the data frames. Python3 1== # To find the comparison result df1.equals(df2) Output : The output is False because the two dataframes are not equal to each other. They have different elements. Example #2: Use equals() function to test for equality between two data frame object with NaN values. Note : NaNs in the same location are considered equal. Python3 # importing pandas as pd import pandas as pd # Creating the first dataframe df1 = pd.DataFrame({"A":[1,2,3], "B":[4,5,None], "C":[7,8,9]}) # Creating the second dataframe df2 = pd.DataFrame({"A":[1,2,3], "B":[4,5,None], "C":[7,8,9]}) # Print the first dataframe df1 # Print the second dataframe df2 Let's perform comparison operation on both the dataframes. Python3 1== # To find the comparison between two dataframes df1.equals(df2) Output : The output scalar boolean value. True indicates that both the dataframes has equal values in the corresponding cells. Comment More infoAdvertise with us Next Article Python | Pandas dataframe.equals() 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.eq() 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.eq() is a wrapper used for the flexible comparison. It provides a con 3 min read Python | Pandas dataframe.mask() 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.mask() function return an object of same shape as self and whose corr 3 min read Python | Pandas dataframe.ne() 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.ne() function checks for inequality of a dataframe element with a cons 2 min read Python | Pandas Dataframe.iat[ ] 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 iat[] method is used to return data in a dataframe at the passed location. The 2 min read Python | Pandas DataFrame.isin() In this article, we will explore the Pandas DataFrame.isin() method provided by the Pandas library in Python. Python is widely recognized for its proficiency in data analysis, largely attributed to its exceptional ecosystem of data-centric packages. Among these, Pandas stands out as an essential too 2 min read Python | Pandas DataFrame.empty 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.at[ ] 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 at[] is used to return data in a dataframe at the passed location. The passed l 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 Series/Dataframe.any() 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 any() method is applicable both on Series and Dataframe. It checks whether any 3 min read Dataframe Attributes in Python Pandas In this article, we will discuss the different attributes of a dataframe. Attributes are the properties of a DataFrame that can be used to fetch data or any information related to a particular dataframe. The syntax of writing an attribute is: DataFrame_name.attribute These are the attributes of the 11 min read Like