Join GitHub today
to_msgpack fails for Dataframes with numpy bools #18390
Code Sample, a copy-pastable example if possible
import pandas as pd import numpy as np pd.DataFrame(pd.Series((np.bool_(1), 2, 3, 4, 5))).to_msgpack('test.msg')
When trying to export Dataframes containing numpy bools with the DataFrame.to_msgpack() function one gets the exception:
I'm guessing this is because the isinstance check on line 136 of pandas.io.msgpack._packer.pyx returns False for numpy.bool_ .
I'd expect DataFrames with numpy bools in them to serialize just like ones with Python bools do.