Skip to content

Commit 16e1a08

Browse files
committed
Ensure column order
1 parent b260e75 commit 16e1a08

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/tests/frame/test_convert_to.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,5 +311,7 @@ def test_to_dict_index_dtypes(self, into, expected):
311311
'float_col': [1.0, 2.0, 3.0]})
312312

313313
result = df.to_dict(orient='index', into=into)
314-
tm.assert_frame_equal(DataFrame.from_dict(result, orient='index'),
315-
DataFrame.from_dict(expected, orient='index'))
314+
cols = ['int_col', 'float_col']
315+
result = DataFrame.from_dict(result, orient='index')[cols]
316+
expected = DataFrame.from_dict(expected, orient='index')[cols]
317+
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)