def test_unstack_fill_frame_object():
    data = pd.Series(['a', 'b', 'c', 'a'], dtype='object')
    data.index = pd.MultiIndex.from_tuples([('x', 'a'), ('x', 'b'), ('y', 'b'), ('z', 'a')])
    result = data.unstack()
    expected = pd.DataFrame({'a': ['a', np.nan, 'a'], 'b': ['b', 'c', np.nan]}, index=list('xyz'))
    assert_frame_equal(result, expected)
    result = data.unstack(fill_value='d')
    expected = pd.DataFrame({'a': ['a', 'd', 'a'], 'b': ['b', 'c', 'd']}, index=list('xyz'))
    assert_frame_equal(result, expected)
def test_unstack_fill_frame_object():
    data = pd.Series(['a', 'b', 'c', 'a'], dtype='object')
    data.index = pd.MultiIndex.from_tuples([('x', 'a'), ('x', 'b'), ('y', 'b'), ('z', 'a')])
    result = data.unstack()
    expected = pd.DataFrame({'a': ['a', np.nan, 'a'], 'b': ['b', 'c', np.nan]}, index=list('xyz'))
    assert_frame_equal(result, expected)
    result = data.unstack(fill_value='d')
    expected = pd.DataFrame({'a': ['a', 'd', 'a'], 'b': ['b', 'c', 'd']}, index=list('xyz'))
    assert_frame_equal(result, expected)