Closed
Description
Code Sample, a copy-pastable example if possible
import pandas as pd
df = pd.DataFrame({'a': list('aab'), 'b': list('bba')})
df.a = df.a.astype('category')
df.b = df.b.astype('category')
df.astype('object')
# ValueError: Wrong number of dimensions
related failure
In [1]: df = pd.DataFrame({
...: 'a': ['foo', 'bar', None],
...: 'b': ['baz', 'quux', None]
...: }, dtype='category')
...: df
...:
Out[1]:
a b
0 foo baz
1 bar quux
2 NaN NaN
In [2]: df.where(df.isnull(), None)
---------------------------------------------------------------------------
ValueError: Wrong number of items passed 3, placement implies 1
Problem description
Object dataframes can contain any Python object so anything should be convertible to them. Split off of #16979.