diff --git a/pandas/tests/frame/test_combine_concat.py b/pandas/tests/frame/test_combine_concat.py index 59497153c85242..c2364dc135a9ae 100644 --- a/pandas/tests/frame/test_combine_concat.py +++ b/pandas/tests/frame/test_combine_concat.py @@ -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):