Skip to content
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

iloc[list] fails with new pandas #19

Closed
michcio1234 opened this issue Nov 1, 2017 · 1 comment · Fixed by #20
Closed

iloc[list] fails with new pandas #19

michcio1234 opened this issue Nov 1, 2017 · 1 comment · Fixed by #20

Comments

@michcio1234
Copy link

michcio1234 commented Nov 1, 2017

Consider this code:

import sparsity as sp
import numpy as np

sf = sp.SparseFrame(np.random.rand(10, 10))
sf.iloc[[2, 3]]

With pandas 0.20.3 it works as expected, but with pandas 0.21.0 following error is thrown:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mdank/python_libs/sparsity/sparsity/indexing.py", line 16, in __getitem__
    return super().__getitem__(item)
  File "/home/mdank/anaconda3/envs/sparsity-new-pandas/lib/python3.6/site-packages/pandas/core/indexing.py", line 1373, in __getitem__
    return self._getitem_axis(maybe_callable, axis=axis)
  File "/home/mdank/anaconda3/envs/sparsity-new-pandas/lib/python3.6/site-packages/pandas/core/indexing.py", line 1819, in _getitem_axis
    return self._get_list_axis(key, axis=axis)
  File "/home/mdank/anaconda3/envs/sparsity-new-pandas/lib/python3.6/site-packages/pandas/core/indexing.py", line 1794, in _get_list_axis
    return self.obj._take(key, axis=axis, convert=False)
AttributeError: 'SparseFrame' object has no attribute '_take'

iloc with single index (eg. sf.iloc[2]) works ok with both pandas versions.

@kayibal
Copy link

kayibal commented Nov 1, 2017

ok I'll check this thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants