Skip to content

Commit 0eb250a

Browse files
committed
Ensure column order
1 parent b260e75 commit 0eb250a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/tests/frame/test_convert_to.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -311,5 +311,8 @@ 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)
318+

0 commit comments

Comments
 (0)