The most common intent is handled like this:
def assertFrameEqual(df1, df2, **kwds ):
""" Assert that two dataframes are equal, ignoring ordering of columns"""
from pandas.util.testing import assert_frame_equal
return assert_frame_equal(df1.sort_index(axis=1), df2.sort_index(axis=1), check_names=True, **kwds )
Of course see pandas.util.testing.assert_frame_equal
for other parameters you can pass
Related Contents:
- How to iterate over rows in a DataFrame in Pandas
- Combine two columns of text in pandas dataframe
- What does `ValueError: cannot reindex from a duplicate axis` mean?
- Pandas index column title or name
- Extracting specific selected columns to new DataFrame as a copy
- Pandas DataFrame to List of Dictionaries
- Add x and y labels to a pandas plot
- Pandas dataframe fillna() only some columns in place
- How do I retrieve the number of columns in a Pandas data frame?
- How to load a tsv file into a Pandas DataFrame?
- Pandas: sum DataFrame rows for given columns
- Get total of Pandas column
- Reading an Excel file in python using pandas
- Making heatmap from pandas DataFrame
- Run an OLS regression with Pandas Data Frame
- Splitting dataframe into multiple dataframes
- Difference between data type ‘datetime64[ns]’ and ‘
- Pandas/Python: Set value of one column based on value in another column
- Forcing pandas .iloc to return a single-row dataframe?
- How to dynamically update a plot in a loop in IPython notebook (within one cell)
- Replace invalid values with None in Pandas DataFrame
- Python – Dimension of Data Frame
- round a single column in pandas
- Rename MultiIndex columns in Pandas
- Plotting a stacked Bar Chart
- pandas multiprocessing apply
- python pandas flatten a dataframe to a list
- Find all columns of dataframe in Pandas whose type is float, or a particular type?
- How do I get the name of the rows from the index of a data frame?
- join or merge with overwrite in pandas
- Selecting Pandas Columns by dtype
- Any way to get mappings of a label encoder in Python pandas?
- import pandas_datareader gives ImportError: cannot import name ‘is_list_like’
- return default if pandas dataframe.loc location doesn’t exist
- Pandas ValueError Arrays Must be All Same Length
- ‘module’ object has no attribute ‘DataFrame’ [closed]
- When to apply(pd.to_numeric) and when to astype(np.float64) in python?
- How can I speed up reading multiple files and putting the data into a dataframe?
- Filter out rows based on list of strings in Pandas
- JOIN two dataframes on common column in python
- Pandas dataframe hide index functionality?
- Pandas Dataframe Find Rows Where all Columns Equal
- Imputation of missing values for categories in pandas
- How to set all the values of an existing Pandas DataFrame to zero?
- Pivot Tables of Counts in Pandas DataFrame
- Cumsum as a new column in an existing Pandas dataframe
- Pandas: assign an index to each group identified by groupby
- Pandas: Get values from column that appear more than X times
- mean calculation in pandas excluding zeros
- Map dataframe index using dictionary