Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
BUG: setting a sparse column in a frame buggy #8131
Comments
jreback
added this to the
0.15.0
milestone
Aug 28, 2014
jreback
added Bug Sparse
labels
Aug 28, 2014
jreback
modified the milestone: 0.15.1, 0.15.0
Sep 9, 2014
|
cc @immerrr |
|
Let me check that... |
|
The issue is in In [9]: df = pd.DataFrame({'c_1': list('abc')})
In [10]: sp_col = pd.Series([0,0,1]).to_sparse(fill_value=0)
In [11]: df._sanitize_column('n', sp_col)
Out[11]: array([[1]])Hacking sanitize column is easy, but it uncovers yet another issue with ndarray subclassing: In [54]: sp_arr = pd.SparseArray([0,0,1], fill_value=0)
In [55]: sp_arr
Out[55]:
[0, 0, 1.0]
Fill: 0
IntIndex
Indices: array([2], dtype=int32)
In [56]: np.asarray(sp_arr)
Out[56]: array([ 1.])This happens because |
|
yep, prob |
jreback commentedAug 28, 2014
from SO
thought this was well tested.....