|
18 | 18 | PeriodDtype,
|
19 | 19 | )
|
20 | 20 |
|
21 |
| -import pandas as pd |
22 | 21 | from pandas import (
|
23 | 22 | Categorical,
|
24 | 23 | DataFrame,
|
@@ -793,29 +792,22 @@ def test_setitem_slice_position(self):
|
793 | 792 | tm.assert_frame_equal(df, expected)
|
794 | 793 |
|
795 | 794 | @pytest.mark.parametrize("indexer", [tm.setitem, tm.iloc])
|
796 |
| - @pytest.mark.parametrize("box", [Series, np.array, list, pd.array]) |
| 795 | + @pytest.mark.parametrize("box", [Series, np.array, list]) |
797 | 796 | @pytest.mark.parametrize("n", [1, 2, 3])
|
798 |
| - def test_setitem_slice_indexer_broadcasting_rhs(self, n, box, indexer): |
| 797 | + def test_setitem_broadcasting_rhs(self, n, box, indexer): |
799 | 798 | # GH#40440
|
| 799 | + # TODO: Add pandas array as box after GH#40933 is fixed |
800 | 800 | df = DataFrame([[1, 3, 5]] + [[2, 4, 6]] * n, columns=["a", "b", "c"])
|
801 | 801 | indexer(df)[1:] = box([10, 11, 12])
|
802 | 802 | expected = DataFrame([[1, 3, 5]] + [[10, 11, 12]] * n, columns=["a", "b", "c"])
|
803 | 803 | tm.assert_frame_equal(df, expected)
|
804 | 804 |
|
805 |
| - @pytest.mark.parametrize("box", [Series, np.array, list, pd.array]) |
806 |
| - @pytest.mark.parametrize("n", [1, 2, 3]) |
807 |
| - def test_setitem_list_indexer_broadcasting_rhs(self, n, box): |
808 |
| - # GH#40440 |
809 |
| - df = DataFrame([[1, 3, 5]] + [[2, 4, 6]] * n, columns=["a", "b", "c"]) |
810 |
| - df.iloc[list(range(1, n + 1))] = box([10, 11, 12]) |
811 |
| - expected = DataFrame([[1, 3, 5]] + [[10, 11, 12]] * n, columns=["a", "b", "c"]) |
812 |
| - tm.assert_frame_equal(df, expected) |
813 |
| - |
814 | 805 | @pytest.mark.parametrize("indexer", [tm.setitem, tm.iloc])
|
815 |
| - @pytest.mark.parametrize("box", [Series, np.array, list, pd.array]) |
| 806 | + @pytest.mark.parametrize("box", [Series, np.array, list]) |
816 | 807 | @pytest.mark.parametrize("n", [1, 2, 3])
|
817 |
| - def test_setitem_slice_broadcasting_rhs_mixed_dtypes(self, n, box, indexer): |
| 808 | + def test_setitem_broadcasting_rhs_mixed_dtypes(self, n, box, indexer): |
818 | 809 | # GH#40440
|
| 810 | + # TODO: Add pandas array as box after GH#40933 is fixed |
819 | 811 | df = DataFrame(
|
820 | 812 | [[1, 3, 5], ["x", "y", "z"]] + [[2, 4, 6]] * n, columns=["a", "b", "c"]
|
821 | 813 | )
|
|
0 commit comments