17
17
Sequence ,
18
18
Union ,
19
19
cast ,
20
+ overload ,
20
21
)
21
22
import warnings
22
23
import zipfile
27
28
from pandas ._typing import (
28
29
DtypeArg ,
29
30
FilePath ,
31
+ IntStrT ,
30
32
ReadBuffer ,
31
33
StorageOptions ,
32
34
WriteExcelBuffer ,
349
351
)
350
352
351
353
354
+ @overload
355
+ def read_excel (
356
+ io ,
357
+ sheet_name : str | int ,
358
+ header : int | Sequence [int ] | None = ...,
359
+ names = ...,
360
+ index_col : int | Sequence [int ] | None = ...,
361
+ usecols = ...,
362
+ squeeze : bool | None = ...,
363
+ dtype : DtypeArg | None = ...,
364
+ engine : Literal ["xlrd" , "openpyxl" , "odf" , "pyxlsb" ] | None = ...,
365
+ converters = ...,
366
+ true_values : Iterable [Hashable ] | None = ...,
367
+ false_values : Iterable [Hashable ] | None = ...,
368
+ skiprows : Sequence [int ] | int | Callable [[int ], object ] | None = ...,
369
+ nrows : int | None = ...,
370
+ na_values = ...,
371
+ keep_default_na : bool = ...,
372
+ na_filter : bool = ...,
373
+ verbose : bool = ...,
374
+ parse_dates = ...,
375
+ date_parser = ...,
376
+ thousands : str | None = ...,
377
+ decimal : str = ...,
378
+ comment : str | None = ...,
379
+ skipfooter : int = ...,
380
+ convert_float : bool | None = ...,
381
+ mangle_dupe_cols : bool = ...,
382
+ storage_options : StorageOptions = ...,
383
+ ) -> DataFrame :
384
+ ...
385
+
386
+
387
+ @overload
388
+ def read_excel (
389
+ io ,
390
+ sheet_name : list [IntStrT ] | None ,
391
+ header : int | Sequence [int ] | None = ...,
392
+ names = ...,
393
+ index_col : int | Sequence [int ] | None = ...,
394
+ usecols = ...,
395
+ squeeze : bool | None = ...,
396
+ dtype : DtypeArg | None = ...,
397
+ engine : Literal ["xlrd" , "openpyxl" , "odf" , "pyxlsb" ] | None = ...,
398
+ converters = ...,
399
+ true_values : Iterable [Hashable ] | None = ...,
400
+ false_values : Iterable [Hashable ] | None = ...,
401
+ skiprows : Sequence [int ] | int | Callable [[int ], object ] | None = ...,
402
+ nrows : int | None = ...,
403
+ na_values = ...,
404
+ keep_default_na : bool = ...,
405
+ na_filter : bool = ...,
406
+ verbose : bool = ...,
407
+ parse_dates = ...,
408
+ date_parser = ...,
409
+ thousands : str | None = ...,
410
+ decimal : str = ...,
411
+ comment : str | None = ...,
412
+ skipfooter : int = ...,
413
+ convert_float : bool | None = ...,
414
+ mangle_dupe_cols : bool = ...,
415
+ storage_options : StorageOptions = ...,
416
+ ) -> dict [IntStrT , DataFrame ]:
417
+ ...
418
+
419
+
352
420
@deprecate_nonkeyword_arguments (allowed_args = ["io" , "sheet_name" ], version = "2.0" )
353
421
@Appender (_read_excel_doc )
354
422
def read_excel (
355
423
io ,
356
- sheet_name : str | int | list [int ] | list [ str ] | None = 0 ,
424
+ sheet_name : str | int | list [IntStrT ] | None = 0 ,
357
425
header : int | Sequence [int ] | None = 0 ,
358
426
names = None ,
359
427
index_col : int | Sequence [int ] | None = None ,
@@ -379,7 +447,7 @@ def read_excel(
379
447
convert_float : bool | None = None ,
380
448
mangle_dupe_cols : bool = True ,
381
449
storage_options : StorageOptions = None ,
382
- ) -> DataFrame | dict [str , DataFrame ] | dict [ int , DataFrame ]:
450
+ ) -> DataFrame | dict [IntStrT , DataFrame ]:
383
451
384
452
should_close = False
385
453
if not isinstance (io , ExcelFile ):
0 commit comments