Skip to content

Commit

Permalink
#23049: test for Fatal Stack Overflow stemming From Misuse of astype(…
Browse files Browse the repository at this point in the history
…'category') (#25366)
  • Loading branch information
Shivam Rana authored and jreback committed Feb 19, 2019
1 parent 590cb54 commit 9561b96
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 9561b96

Please sign in to comment.