diff --git a/pandas/io/tests/data/testskiprows.xls b/pandas/io/tests/data/testskiprows.xls new file mode 100644 index 0000000000000..21ccd30ec62da Binary files /dev/null and b/pandas/io/tests/data/testskiprows.xls differ diff --git a/pandas/io/tests/data/testskiprows.xlsm b/pandas/io/tests/data/testskiprows.xlsm new file mode 100644 index 0000000000000..f5889ded4637a Binary files /dev/null and b/pandas/io/tests/data/testskiprows.xlsm differ diff --git a/pandas/io/tests/data/testskiprows.xlsx b/pandas/io/tests/data/testskiprows.xlsx new file mode 100644 index 0000000000000..2d7ce943a7214 Binary files /dev/null and b/pandas/io/tests/data/testskiprows.xlsx differ diff --git a/pandas/io/tests/test_excel.py b/pandas/io/tests/test_excel.py index 40cbd97ea539f..e7ed83b5708f9 100644 --- a/pandas/io/tests/test_excel.py +++ b/pandas/io/tests/test_excel.py @@ -660,6 +660,21 @@ def test_read_excel_chunksize(self): pd.read_excel(os.path.join(self.dirpath, 'test1' + self.ext), chunksize=100) + def test_read_excel_skiprows_list(self): + #GH 4903 + actual = pd.read_excel(os.path.join(self.dirpath, 'testskiprows' + self.ext), + 'skiprows_list', skiprows=[0,2]) + expected = DataFrame([[1, 2.5, pd.Timestamp('2015-01-01'), True], + [2, 3.5, pd.Timestamp('2015-01-02'), False], + [3, 4.5, pd.Timestamp('2015-01-03'), False], + [4, 5.5, pd.Timestamp('2015-01-04'), True]], + columns = ['a','b','c','d']) + tm.assert_frame_equal(actual, expected) + + actual = pd.read_excel(os.path.join(self.dirpath, 'testskiprows' + self.ext), + 'skiprows_list', skiprows=np.array([0,2])) + tm.assert_frame_equal(actual, expected) + class XlsReaderTests(XlrdTests, tm.TestCase): ext = '.xls' engine_name = 'xlrd'