28
28
from pandas ._typing import (
29
29
DtypeArg ,
30
30
FilePath ,
31
- IntStrT ,
32
31
ReadBuffer ,
33
32
StorageOptions ,
34
33
WriteExcelBuffer ,
@@ -387,7 +386,7 @@ def read_excel(
387
386
@overload
388
387
def read_excel (
389
388
io ,
390
- sheet_name : list [IntStrT ] | None ,
389
+ sheet_name : list [int ] ,
391
390
header : int | Sequence [int ] | None = ...,
392
391
names = ...,
393
392
index_col : int | Sequence [int ] | None = ...,
@@ -413,15 +412,48 @@ def read_excel(
413
412
convert_float : bool | None = ...,
414
413
mangle_dupe_cols : bool = ...,
415
414
storage_options : StorageOptions = ...,
416
- ) -> dict [IntStrT , DataFrame ]:
415
+ ) -> dict [int , DataFrame ]:
416
+ ...
417
+
418
+
419
+ @overload
420
+ def read_excel (
421
+ io ,
422
+ sheet_name : list [str ] | None ,
423
+ header : int | Sequence [int ] | None = ...,
424
+ names = ...,
425
+ index_col : int | Sequence [int ] | None = ...,
426
+ usecols = ...,
427
+ squeeze : bool | None = ...,
428
+ dtype : DtypeArg | None = ...,
429
+ engine : Literal ["xlrd" , "openpyxl" , "odf" , "pyxlsb" ] | None = ...,
430
+ converters = ...,
431
+ true_values : Iterable [Hashable ] | None = ...,
432
+ false_values : Iterable [Hashable ] | None = ...,
433
+ skiprows : Sequence [int ] | int | Callable [[int ], object ] | None = ...,
434
+ nrows : int | None = ...,
435
+ na_values = ...,
436
+ keep_default_na : bool = ...,
437
+ na_filter : bool = ...,
438
+ verbose : bool = ...,
439
+ parse_dates = ...,
440
+ date_parser = ...,
441
+ thousands : str | None = ...,
442
+ decimal : str = ...,
443
+ comment : str | None = ...,
444
+ skipfooter : int = ...,
445
+ convert_float : bool | None = ...,
446
+ mangle_dupe_cols : bool = ...,
447
+ storage_options : StorageOptions = ...,
448
+ ) -> dict [str , DataFrame ]:
417
449
...
418
450
419
451
420
452
@deprecate_nonkeyword_arguments (allowed_args = ["io" , "sheet_name" ], version = "2.0" )
421
453
@Appender (_read_excel_doc )
422
454
def read_excel (
423
455
io ,
424
- sheet_name : str | int | list [IntStrT ] | None = 0 ,
456
+ sheet_name : str | int | list [int ] | list [ str ] | None = 0 ,
425
457
header : int | Sequence [int ] | None = 0 ,
426
458
names = None ,
427
459
index_col : int | Sequence [int ] | None = None ,
@@ -447,7 +479,7 @@ def read_excel(
447
479
convert_float : bool | None = None ,
448
480
mangle_dupe_cols : bool = True ,
449
481
storage_options : StorageOptions = None ,
450
- ) -> DataFrame | dict [IntStrT , DataFrame ]:
482
+ ) -> DataFrame | dict [int , DataFrame ] | dict [ str , DataFrame ]:
451
483
452
484
should_close = False
453
485
if not isinstance (io , ExcelFile ):
0 commit comments