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

Automatic PR for ee41cc3c-626d-461f-9d54-f08ab7d19578 #101

Open
wants to merge 1 commit into
base: ee41cc3c-626d-461f-9d54-f08ab7d19578-base
Choose a base branch
from
Open
Changes from all commits
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
14 changes: 1 addition & 13 deletions pandas/tests/arrays/sparse/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,16 +477,4 @@ def test_drop_duplicates_fill_value():
df = pd.DataFrame(np.zeros((5, 5))).apply(lambda x: SparseArray(x, fill_value=0))
result = df.drop_duplicates()
expected = pd.DataFrame({i: SparseArray([0.0], fill_value=0) for i in range(5)})
tm.assert_frame_equal(result, expected)


def test_zero_sparse_column():
# GH 27781
df1 = pd.DataFrame({"A": SparseArray([0, 0, 0]), "B": [1, 2, 3]})
df2 = pd.DataFrame({"A": SparseArray([0, 1, 0]), "B": [1, 2, 3]})
result = df1.loc[df1["B"] != 2]
expected = df2.loc[df2["B"] != 2]
tm.assert_frame_equal(result, expected)

expected = pd.DataFrame({"A": SparseArray([0, 0]), "B": [1, 3]}, index=[0, 2])
tm.assert_frame_equal(result, expected)
tm.assert_frame_equal(result, expected)