We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c126ddd commit 9ae990dCopy full SHA for 9ae990d
pandas/tests/test_multilevel.py
@@ -290,6 +290,30 @@ def test_datetime_object_multiindex(self):
290
291
tm.assert_frame_equal(result, expected)
292
293
+ def test_multiindex_with_na(self):
294
+ df = DataFrame(
295
+ [
296
+ ["A", np.nan, 1.23, 4.56],
297
+ ["A", "G", 1.23, 4.56],
298
+ ["A", "D", 9.87, 10.54],
299
+ ],
300
+ columns=["pivot_0", "pivot_1", "col_1", "col_2"],
301
+ ).set_index(["pivot_0", "pivot_1"])
302
+
303
+ df.at[("A", "F"), "col_2"] = 0.0
304
305
+ expected = DataFrame(
306
307
308
309
310
+ ["A", "F", np.nan, 0.0],
311
312
313
314
315
+ tm.assert_frame_equal(df, expected)
316
317
318
class TestSorted:
319
"""everything you wanted to test about sorting"""
0 commit comments