Skip to content

Commit 36e171c

Browse files
committed
TST: Adding test to concat Sparse arrays
1 parent 50ae37d commit 36e171c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/reshape/test_concat.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2739,3 +2739,13 @@ def test_concat_empty_df_object_dtype():
27392739
result = pd.concat([df_1, df_2], axis=0)
27402740
expected = df_1.astype(object)
27412741
tm.assert_frame_equal(result, expected)
2742+
2743+
2744+
def test_concat_sparse():
2745+
# GH 23557
2746+
a = pd.Series(pd.SparseArray([0, 1, 2]))
2747+
expected = pd.DataFrame(data=[[0, 0], [1, 1], [2, 2]]).astype(
2748+
pd.SparseDtype(np.intp, 0)
2749+
)
2750+
result = pd.concat([a, a], axis=1)
2751+
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)