We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4f0786 commit 7ae07bdCopy full SHA for 7ae07bd
pandas/tests/frame/test_explode.py
@@ -150,6 +150,36 @@ def test_usecase():
150
dtype=object,
151
).set_index("my_index"),
152
),
153
+ (
154
+ pd.DataFrame(
155
+ {
156
+ "col": [[1, 2], [3, 4]],
157
+ "other_col": ["a", "b"],
158
+ "my_first_index": [0, 0],
159
+ "my_second_index": [1, 1],
160
+ }
161
+ ).set_index(["my_first_index", "my_second_index"]),
162
163
164
+ "col": [1, 2, 3, 4],
165
+ "other_col": ["a", "a", "b", "b"],
166
+ "my_first_index": [0, 0, 0, 0],
167
+ "my_second_index": [1, 1, 1, 1],
168
+ },
169
+ dtype=object,
170
171
+ ),
172
173
174
+ {"col": [[1, 2], [3, 4]], "other_col": ["a", "b"]},
175
+ pd.MultiIndex.from_tuples([(0, 1), (0, 1)]),
176
177
178
+ {"col": [1, 2, 3, 4], "other_col": ["a", "a", "b", "b"]},
179
+ index=pd.MultiIndex.from_tuples([(0, 1), (0, 1), (0, 1), (0, 1)]),
180
181
182
183
],
184
)
185
def test_duplicate_index(df, expected):
0 commit comments