-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: more testing of indexing with sparse #4400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think that this was fixed at some point and can be closed. In [4]: data = np.zeros((2,2))
In [5]: data[:] = np.nan
In [6]: data[1,1] = 1
In [7]: df = pd.DataFrame(data)
In [9]: df.ix[:,1]
Out[9]:
0 NaN
1 1
Name: 1, dtype: float64
In [10]: df.to_sparse().ix[:,1]
Out[10]:
0 NaN
1 1
Name: 1, dtype: float64
BlockIndex
Block locations: array([1], dtype=int32)
Block lengths: array([1], dtype=int32)
In [24]: df.to_sparse().iloc[1,1]
Out[24]: 1.0
In [25]: df.to_sparse().iloc[1,0]
Out[25]: nan In [3]: pd.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 3.4.1.final.0
python-bits: 64
OS: Linux
OS-release: 2.6.32-431.17.1.el6.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.15.2
nose: 1.3.4
Cython: 0.20.2
numpy: 1.9.1
scipy: 0.14.1 |
ok. I am not 100% sure that this is actually tested though. Can you confirm? If it is we want to add this issue reference, and if not put some tests in place. thxs. |
I searched
Maybe inheriting from |
you should run the tests with -v and see as since it inhersts tests from test_frame.py as well (and test_series). |
It appears to me that the tests inherited from From what I can gather, it seems that the "do it right" solution might be to reuse some of the |
after #12779, this issue is adding more tests for |
related to #4400 Added more tests for sparse indexing. `SparseArray.take`` has optimized logic to omit dense ``np.ndarray`` creation. SparseSeires.iloc` can work with negative indices. Made ``SparseArray.take`` to handle negative indices as the same rule as ``Index`` (#12676) Author: sinhrks <[email protected]> Closes #12796 from sinhrks/sparse_test_at and squashes the following commits: df1f056 [sinhrks] ENH/PERF SparseArray.take indexing
related is #6076 (
loc
not working either)It would be nice if common operations like indexing/slicing is available for sparse dataframes as for their dense counterparts.
Thanks!
The text was updated successfully, but these errors were encountered: