# assert_frame_equal()

*noun*

say it: **“uh-SERT FRAME EE-kwul”** **/əˈsɝt ˈfreɪm ˈikwəl/**

A pandas testing tool that checks two tables match exactly, and says what differs when they don't.

## What does **assert_frame_equal()** do in pandas?

**assert_frame_equal()** (`pd.testing.assert_frame_equal`) compares two DataFrames in a test: their column names and
order, their values and their types. When they don't match, it fails and says which column differs and how.

```python
def test_add_total():
    sales = pd.DataFrame({"item": ["Street Tacos"], "quantity": [2], "price": [9.00]})
    expected = sales.assign(total=[18.0])
    pd.testing.assert_frame_equal(add_total(sales), expected)
```

## In a sentence

- “**assert_frame_equal()** said the total column was int64, not float64.”
- “The test builds the expected table and checks it with **assert_frame_equal()**.”

Level: Freelancer · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=4)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/assert-frame-equal
