From bb8e1da963da95db3868510fb2830e8d6a6820ac Mon Sep 17 00:00:00 2001 From: Chris Kerr Date: Tue, 6 Jun 2017 10:05:15 +0200 Subject: [PATCH] Added test to reproduce issue #16583 --- pandas/tests/io/test_pytables.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandas/tests/io/test_pytables.py b/pandas/tests/io/test_pytables.py index 040345db83c2b7..15fbdf59bfe35f 100644 --- a/pandas/tests/io/test_pytables.py +++ b/pandas/tests/io/test_pytables.py @@ -5191,6 +5191,14 @@ def test_query_compare_column_type(self): expected = df.loc[[], :] tm.assert_frame_equal(expected, result) + def test_read_hdf_series_fixed(self): + # GH 16583 + series = pd.Series([1, 2, 3]) + with ensure_clean_path(self.path) as path: + series.to_hdf(path, key='data', format='fixed') + result = pd.read_hdf(path, key='data', mode='r') + tm.assert_series_equal(result, series) + @pytest.mark.skipif(sys.version_info < (3, 6), reason="Need python 3.6") def test_fspath(self): with tm.ensure_clean('foo.h5') as path: