how to ignore index comparison for pandas assert frame equal

If you really don’t care about the index being equal, you can drop the index as follows:

assert_frame_equal(d1.reset_index(drop=True), d2.reset_index(drop=True))

Leave a Comment