@@ -4571,6 +4571,35 @@ def test_duplicate_column_name(self):
4571
4571
other = read_hdf (path , 'df' )
4572
4572
tm .assert_frame_equal (df , other )
4573
4573
4574
+ def test_non_unique_items_axis (self ):
4575
+ panel = Panel (
4576
+ data = np .zeros ((2 , 2 , 2 )),
4577
+ items = ["a" , "a" ],
4578
+ major_axis = ["b" , "b" ],
4579
+ minor_axis = ["c" , "c" ]
4580
+ )
4581
+
4582
+ with ensure_clean_path (self .path ) as path :
4583
+ self .assertRaises (
4584
+ ValueError , panel .to_hdf , path , 'panel' , format = 'fixed'
4585
+ )
4586
+
4587
+ panel .to_hdf (path , 'panel' , format = 'table' )
4588
+ other = read_hdf (path , 'panel' )
4589
+ tm .assert_panel_equal (panel , other )
4590
+
4591
+ def test_non_unique_series_index (self ):
4592
+ series = Series ([0 , 0 ], index = ["a" , "a" ])
4593
+
4594
+ with ensure_clean_path (self .path ) as path :
4595
+ series .to_hdf (path , 'series' , format = "fixed" )
4596
+ other = read_hdf (path , 'series' )
4597
+ tm .assert_series_equal (series , other )
4598
+
4599
+ series .to_hdf (path , 'series' , format = 'table' )
4600
+ other = read_hdf (path , 'series' )
4601
+ tm .assert_series_equal (series , other )
4602
+
4574
4603
4575
4604
def _test_sort (obj ):
4576
4605
if isinstance (obj , DataFrame ):
0 commit comments