File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -5191,6 +5191,16 @@ def test_query_compare_column_type(self):
5191
5191
expected = df .loc [[], :]
5192
5192
tm .assert_frame_equal (expected , result )
5193
5193
5194
+ def test_read_hdf_series_fixed (self ):
5195
+ # GH 16583
5196
+ # Tests that reading a Series saved to an HDF file in 'fixed' format
5197
+ # still works if a mode='r' argument is supplied
5198
+ series = tm .makeFloatSeries ()
5199
+ with ensure_clean_path (self .path ) as path :
5200
+ series .to_hdf (path , key = 'data' , format = 'fixed' )
5201
+ result = pd .read_hdf (path , key = 'data' , mode = 'r' )
5202
+ tm .assert_series_equal (result , series )
5203
+
5194
5204
@pytest .mark .skipif (sys .version_info < (3 , 6 ), reason = "Need python 3.6" )
5195
5205
def test_fspath (self ):
5196
5206
with tm .ensure_clean ('foo.h5' ) as path :
You can’t perform that action at this time.
0 commit comments