File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -230,3 +230,5 @@ Bug Fixes
230
230
231
231
232
232
- Bug in ``df.replace`` while replacing value in mixed dtype ``Dataframe`` (:issue:`11698`)
233
+
234
+ - Bug in ``read_excel`` failing to read any non-empty sheets when empty sheets exist and ``sheetname=None`` (:issue:`11711`)
Original file line number Diff line number Diff line change @@ -391,7 +391,8 @@ def _parse_cell(cell_contents,cell_typ):
391
391
data .append (row )
392
392
393
393
if sheet .nrows == 0 :
394
- return DataFrame ()
394
+ output [asheetname ] = DataFrame ()
395
+ continue
395
396
396
397
if com .is_list_like (header ) and len (header ) == 1 :
397
398
header = header [0 ]
Original file line number Diff line number Diff line change @@ -382,6 +382,15 @@ def test_reading_multiple_specific_sheets(self):
382
382
tm .assert_contains_all (expected_keys , dfs .keys ())
383
383
assert len (expected_keys ) == len (dfs .keys ())
384
384
385
+ def test_reading_all_sheets_with_blank (self ):
386
+ # Test reading all sheetnames by setting sheetname to None,
387
+ # In the case where some sheets are blank.
388
+ # Issue #11711
389
+ basename = 'blank_with_header'
390
+ dfs = self .get_exceldf (basename , sheetname = None )
391
+ expected_keys = ['Sheet1' , 'Sheet2' , 'Sheet3' ]
392
+ tm .assert_contains_all (expected_keys , dfs .keys ())
393
+
385
394
# GH6403
386
395
def test_read_excel_blank (self ):
387
396
actual = self .get_exceldf ('blank' , 'Sheet1' )
You can’t perform that action at this time.
0 commit comments