Skip to content

Commit 40793c1

Browse files
committed
Fixed #38419 - BUG: set_index screws up the dtypes on empty DataFrames
1 parent f30caa0 commit 40793c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/tests/frame/methods/test_set_index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def test_set_index_empty_dataframe(self):
5656
if df.empty:
5757
df = DataFrame(columns=list(df.columns.values))
5858

59-
expected = df.set_index(['a', 'b'])
60-
assert (df.loc[:, ['a', 'b']].dtypes == expected.index.to_frame().dtypes).all()
59+
expected = df.set_index(["a", "b"])
60+
assert (df.loc[:, ["a", "b"]].dtypes == expected.index.to_frame().dtypes).all()
6161

6262
def test_set_index_multiindexcolumns(self):
6363
columns = MultiIndex.from_tuples([("foo", 1), ("foo", 2), ("bar", 1)])

0 commit comments

Comments
 (0)