(self)
| 311 | tm.assert_frame_equal(result, expected) |
| 312 | |
| 313 | def test_preserve_category(self): |
| 314 | # GH 15853 |
| 315 | data = DataFrame({"A": [1, 2], "B": pd.Categorical(["X", "Y"])}) |
| 316 | result = melt(data, ["B"], ["A"]) |
| 317 | expected = DataFrame( |
| 318 | {"B": pd.Categorical(["X", "Y"]), "variable": ["A", "A"], "value": [1, 2]} |
| 319 | ) |
| 320 | |
| 321 | tm.assert_frame_equal(result, expected) |
| 322 | |
| 323 | def test_melt_missing_columns_raises(self): |
| 324 | # GH-23575 |