Closed
Description
In [41]: df = DataFrame({'A' : [1,1,2], 'B' : list('aba'), 'C' : ['foo', np.nan, 'bar']}).set_index(['A','B'])
In [42]: df.unstack('B')
Out[42]:
C
B a b
A
1 foo NaN
2 bar None
In [43]: df.unstack('B', fill_value=np.nan)
Out[43]:
C
B a b
A
1 foo NaN
2 bar NaN
Introduced is this PR: #10246
you can make a case to do this as we DO support None
as a fill value, but almost always even with object columns we use np.nan
, unless very explicity set by the user.