October 2019
Beginner to intermediate
674 pages
16h 43m
English
The equals() method checks whether two series or DataFrames are equal in terms of values, datatype, and shape. The column headers could be of different data types. The output is a Boolean. A practical application of this function is shown here. Let's create a new series that we can compare with the existing sample_df DataFrame:
In: compare_series = pd.Series([62, 38, 26, 6, 5])In: sample_df["Wins"].equals(compare_series)Out: True
This function can be applied this way to compare two DataFrames or two series within the same DataFrame.
Read now
Unlock full access