BUG: setting a sparse column in a frame buggy · Issue #8131 · pandas-dev/pandas (original) (raw)

thought this was well tested.....

df = pd.DataFrame({'c_1':['a', 'b', 'c'], 'n_1': [1., 2., 3.]})
df['new_column'] = pd.Series([0, 0, 1]).to_sparse(fill_value=0)
# AssertionError: Shape of new values must be compatible with manager shape