Pandas DataFrame: equals() function

DataFrame - equals() function

The equals() function is used to test whether two objects contain the same elements.

This function allows two Series or DataFrames to be compared against each other to see if they have the same shape and elements. NaNs in the same location are considered equal. The column headers do not need to have the same type, but the elements within the columns must be the same dtype.


DataFrame.equals(self, other)


Name Description Type/Default Value Required / Optional

The other Series or DataFrame to be compared with the first.

Series or DataFrame Required

Returns: bool
True if all elements are the same in both objects, False otherwise.


Download the Pandas DataFrame Notebooks from here.

Previous: DataFrame - drop() function
Next: DataFrame - filter() function

Follow us on Facebook and Twitter for latest update.