pydata/pandas — pull request #6748 by immerrr (2014-03-31 08:33:07+00:00)
Title: BUG: fix NDFrame.as_blocks() for sparse containers

SparseBlocks don't consolidate, so previous implementation silently dropped all but the last blocks for given dtype:

```python
In [1]: pd.__version__
Out[1]: '0.13.1-527-g73506cb'

In [2]: pd.SparseDataFrame({'a': [1,2,3, np.nan, np.nan], 'b': [1,2,3, np.nan, np.nan]})
Out[2]:
a b
0 1 1
1 2 2
2 3 3
3 NaN NaN
4 NaN NaN

[5 rows x 2 columns]

In [3]: _2.blocks
Out[3]:
{'float64': b
0 1
1 2
2 3
3 NaN
4 NaN

[5 rows x 1 columns]}
```

when the last output should be:

```python
In [3]: _2.blocks
Out[3]:
{'float64': a b
0 1 1
1 2 2
2 3 3
3 NaN NaN
4 NaN NaN

[5 rows x 2 columns]}

```

This also drops the `columns` kwarg of as_blocks since it doubles reindex functionality.