8000 CLN: Deprecate pandas.SparseArray for pandas.arrays.SparseArray by Dr-Irv · Pull Request #30656 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

CLN: Deprecate pandas.SparseArray for pandas.arrays.SparseArray #30656

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

Merged
merged 14 commits into from
Jan 5, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove extraneous okwarning. Use black correctly.
  • Loading branch information
Dr-Irv committed Jan 3, 2020
commit d5f365d165e48482e312a8801aa4b744749da777
1 change: 0 additions & 1 deletion doc/source/whatsnew/v0.19.0.rst
8000
Original file line number Diff line numberDiff line change
Expand Up @@ -1198,7 +1198,6 @@ Sparse data structures now gained enhanced support of ``int64`` and ``bool`` ``d
Previously, sparse data were ``float64`` dtype by default, even if all inputs were of ``int`` or ``bool`` dtype. You had to specify ``dtype`` explicitly to create sparse data with ``int64`` dtype. Also, ``fill_value`` had to be specified explicitly because the default was ``np.nan`` which doesn't appear in ``int64`` or ``bool`` data.

.. code-block:: ipython
:okwarning:

In [1]: pd.SparseArray([1, 2, 0, 0])
Out[1]:
Expand Down
4 changes: 3 additions & 1 deletion pandas/tests/arrays/sparse/test_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def test_to_dense(self):
{
"A": pd.arrays.SparseArray([1, 0], dtype=pd.SparseDtype("int64", 0)),
"B": pd.arrays.SparseArray([1, 0], dtype=pd.SparseDtype("int64", 1)),
"C": pd.arrays.SparseArray([1.0, 0.0], dtype=pd.SparseDtype("float64", 0.0)),
"C": pd.arrays.SparseArray(
[1.0, 0.0], dtype=pd.SparseDtype("float64", 0.0)
),
},
index=["b", "a"],
)
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/arrays/sparse/test_arithmetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ def test_with_zerodim_ndarray():

@pytest.mark.parametrize("ufunc", [np.abs, np.exp])
@pytest.mark.parametrize(
"arr", [pd.arrays.SparseArray([0, 0, -1, 1]), pd.arrays.SparseArray([None, None, -1, 1])]
"arr",
[pd.arrays.SparseArray([0, 0, -1, 1]), pd.arrays.SparseArray([None, None, -1, 1])],
)
def test_ufuncs(ufunc, arr):
result = ufunc(arr)
Expand Down
0