Skip to content

Commit 9b4ea44

Browse files
authored
TST: sparse and dense concat test GH30667 (pandas-dev#34355)
1 parent 470dfc6 commit 9b4ea44

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/reshape/test_concat.py

+11
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,17 @@ def test_concat_sparse():
27572757
tm.assert_frame_equal(result, expected)
27582758

27592759

2760+
def test_concat_dense_sparse():
2761+
# GH 30668
2762+
a = pd.Series(pd.arrays.SparseArray([1, None]), dtype=np.float)
2763+
b = pd.Series([1], dtype=np.float)
2764+
expected = pd.Series(data=[1, None, 1], index=[0, 1, 0]).astype(
2765+
pd.SparseDtype(np.float64, None)
2766+
)
2767+
result = pd.concat([a, b], axis=0)
2768+
tm.assert_series_equal(result, expected)
2769+
2770+
27602771
@pytest.mark.parametrize("test_series", [True, False])
27612772
def test_concat_copy_index(test_series, axis):
27622773
# GH 29879

0 commit comments

Comments
 (0)