Skip to content

BUG: Categorical Series breaks when re-serializing with msgpack. #14901

Closed
@jreback

Description

@jreback

xref #8732

df=pd.DataFrame([[1,'John P. Doe'],[2,'Jane Dove'],[1,'John P. Doe']])
df[1]=pd.Categorical(df[1])

DataFrames work fine

In [9]: pd.read_msgpack(df.to_msgpack()).dtypes
Out[9]: 
0       int64
1    category
dtype: object

Series are breaking on re-serialization

In [10]: pd.read_msgpack(df[1].to_msgpack())
ValueError: cannot specify a dtype with a Categorical unless dtype='category'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions