ERR: concat of 2 Series categories does not preserve category dtype · Issue #8641 · pandas-dev/pandas (original) (raw)

xref #8640

As this is inconcistent with how DataFrame concat's work (its a different code-path), so needs updating

s = Series(list('abc'),dtype='category')
s2 = Series(list('abd'),dtype='category')

# this should raise
pd.concat([s,s2])

# this should be a category
pd.concat([s,s])