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

modfy[SparseArray] raises #26946

Closed
TomAugspurger opened this issue Jun 19, 2019 · 0 comments · Fixed by #26947
Closed

modfy[SparseArray] raises #26946

TomAugspurger opened this issue Jun 19, 2019 · 0 comments · Fixed by #26947

Comments

@TomAugspurger
Copy link
Contributor

In [1]: import pandas as pd; import numpy as np

In [2]:         sparse = pd.SparseArray([0.0, 3.5], fill_value=0.0)
   ...:         r1, r2 = np.modf(sparse)
   ...:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-1f85037f7dc7> in <module>
      1 sparse = pd.SparseArray([0.0, 3.5], fill_value=0.0)
----> 2 r1, r2 = np.modf(sparse)

~/sandbox/pandas/pandas/core/arrays/sparse.py in __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
   1700             return self._simple_new(sp_values,
   1701                                     self.sp_index,
-> 1702                                     SparseDtype(sp_values.dtype, fill_value))
   1703
   1704         result = getattr(ufunc, method)(*[np.asarray(x) for x in inputs],

AttributeError: 'tuple' object has no attribute 'dtype'

PR coming soon.

TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue Jun 19, 2019
Closes pandas-dev#26946

(cherry picked from commit 430f664ddbb4dab542b34b2c75b6d086fdef4934)
TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue Jun 19, 2019
Closes pandas-dev#26946

(cherry picked from commit 430f664ddbb4dab542b34b2c75b6d086fdef4934)
TomAugspurger added a commit that referenced this issue Jun 19, 2019
Closes #26946

(cherry picked from commit 430f664ddbb4dab542b34b2c75b6d086fdef4934)
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.

1 participant