Skip to content

Commit 14e5d67

Browse files
louisjbrockmendel
louis
authored andcommitted
TST: category dtype unchanged after concat.
1 parent 8e4424f commit 14e5d67

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/reshape/test_concat.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,6 +2747,16 @@ def test_concat_categorical_tz():
27472747
tm.assert_series_equal(result, expected)
27482748

27492749

2750+
def test_concat_categorical_unch():
2751+
# GH-12007
2752+
df1 = pd.DataFrame(pd.Series(["a", "b", "c"], dtype="category"))
2753+
s1 = pd.Series([0, 1, 2], index=[0, 1, 3])
2754+
df2 = pd.concat([df1, s1], axis=1)
2755+
result = df2.dtypes
2756+
expected = pd.Series(["category", "float64"], index=[0, 0])
2757+
tm.assert_series_equal(result, expected)
2758+
2759+
27502760
def test_concat_datetimeindex_freq():
27512761
# GH 3232
27522762
# Monotonic index result

0 commit comments

Comments
 (0)