Examples
import numpy as np
import pandas as pd
df = pd.DataFrame({1: [20], 2: [30]})
df
DataFrames df and exactly_equal have the same types and values for their elements
and column labels, which will return True:
exactly_equal = pd.DataFrame({1: [20], 2: [30]})
exactly_equal
df.equals(exactly_equal)
DataFrames df and different_column_type have the same element types and values,
but have different types for the column labels, which will still return True:
different_column_type = pd.DataFrame({1.0: [20], 2.0: [30]})
different_column_type
df.equals(different_column_type)
DataFrames df and different_data_type have different types for the same values for their elements,
and will return False even though their column labels are the same values and types:
different_data_type = pd.DataFrame({1: [20.0], 2: [30.0]})
different_data_type
df.equals(different_data_type)