Skip to content

modfy[SparseArray] raises #26946

Closed
Closed
@TomAugspurger

Description

@TomAugspurger
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions