Skip to content

Commit

Permalink
pandas-dev#23049: test for Fatal Stack Overflow stemming From Misuse …
Browse files Browse the repository at this point in the history
…of astype('category') (pandas-dev#25366)
  • Loading branch information
Shivam Rana authored and Pingviinituutti committed Feb 28, 2019
1 parent b8eaa70 commit e412030
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pandas/tests/frame/test_combine_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,16 @@ def test_concat_numerical_names(self):
names=[1, 2]))
tm.assert_frame_equal(result, expected)

def test_concat_astype_dup_col(self):
# gh 23049
df = pd.DataFrame([{'a': 'b'}])
df = pd.concat([df, df], axis=1)

result = df.astype('category')
expected = pd.DataFrame(np.array(["b", "b"]).reshape(1, 2),
columns=["a", "a"]).astype("category")
tm.assert_frame_equal(result, expected)


class TestDataFrameCombineFirst(TestData):

Expand Down

0 comments on commit e412030

Please sign in to comment.