4242from pandas .errors import EmptyDataError
4343from pandas .util ._decorators import (
4444 Appender ,
45- deprecate_kwarg ,
46- deprecate_nonkeyword_arguments ,
4745 doc ,
4846)
4947from pandas .util ._exceptions import find_stack_level
269267 comment string and the end of the current line is ignored.
270268skipfooter : int, default 0
271269 Rows at the end to skip (0-indexed).
272- convert_float : bool, default True
273- Convert integral floats to int (i.e., 1.0 --> 1). If False, all numeric
274- data will be read in as floats: Excel stores all numbers as floats
275- internally.
276-
277- .. deprecated:: 1.3.0
278- convert_float will be removed in a future version
279-
280- mangle_dupe_cols : bool, default True
281- Duplicate columns will be specified as 'X', 'X.1', ...'X.N', rather than
282- 'X'...'X'. Passing in False will cause data to be overwritten if there
283- are duplicate names in the columns.
284-
285- .. deprecated:: 1.5.0
286- Not implemented, and a new argument to specify the pattern for the
287- names of duplicated columns will be added instead
288-
289270{storage_options}
290271
291272 .. versionadded:: 1.2.0
@@ -365,6 +346,7 @@ def read_excel(
365346 io ,
366347 # sheet name is str or int -> DataFrame
367348 sheet_name : str | int = ...,
349+ * ,
368350 header : int | Sequence [int ] | None = ...,
369351 names : list [str ] | None = ...,
370352 index_col : int | Sequence [int ] | None = ...,
@@ -392,8 +374,6 @@ def read_excel(
392374 decimal : str = ...,
393375 comment : str | None = ...,
394376 skipfooter : int = ...,
395- convert_float : bool | None = ...,
396- mangle_dupe_cols : bool = ...,
397377 storage_options : StorageOptions = ...,
398378) -> DataFrame :
399379 ...
@@ -404,6 +384,7 @@ def read_excel(
404384 io ,
405385 # sheet name is list or None -> dict[IntStrT, DataFrame]
406386 sheet_name : list [IntStrT ] | None ,
387+ * ,
407388 header : int | Sequence [int ] | None = ...,
408389 names : list [str ] | None = ...,
409390 index_col : int | Sequence [int ] | None = ...,
@@ -431,20 +412,17 @@ def read_excel(
431412 decimal : str = ...,
432413 comment : str | None = ...,
433414 skipfooter : int = ...,
434- convert_float : bool | None = ...,
435- mangle_dupe_cols : bool = ...,
436415 storage_options : StorageOptions = ...,
437416) -> dict [IntStrT , DataFrame ]:
438417 ...
439418
440419
441420@doc (storage_options = _shared_docs ["storage_options" ])
442- @deprecate_kwarg (old_arg_name = "mangle_dupe_cols" , new_arg_name = None )
443- @deprecate_nonkeyword_arguments (allowed_args = ["io" , "sheet_name" ], version = "2.0" )
444421@Appender (_read_excel_doc )
445422def read_excel (
446423 io ,
447424 sheet_name : str | int | list [IntStrT ] | None = 0 ,
425+ * ,
448426 header : int | Sequence [int ] | None = 0 ,
449427 names : list [str ] | None = None ,
450428 index_col : int | Sequence [int ] | None = None ,
@@ -472,8 +450,6 @@ def read_excel(
472450 decimal : str = "." ,
473451 comment : str | None = None ,
474452 skipfooter : int = 0 ,
475- convert_float : bool | None = None ,
476- mangle_dupe_cols : bool = True ,
477453 storage_options : StorageOptions = None ,
478454) -> DataFrame | dict [IntStrT , DataFrame ]:
479455
@@ -511,8 +487,6 @@ def read_excel(
511487 decimal = decimal ,
512488 comment = comment ,
513489 skipfooter = skipfooter ,
514- convert_float = convert_float ,
515- mangle_dupe_cols = mangle_dupe_cols ,
516490 )
517491 finally :
518492 # make sure to close opened file handles
@@ -588,7 +562,7 @@ def get_sheet_by_index(self, index: int):
588562 pass
589563
590564 @abc .abstractmethod
591- def get_sheet_data (self , sheet , convert_float : bool , rows : int | None = None ):
565+ def get_sheet_data (self , sheet , rows : int | None = None ):
592566 pass
593567
594568 def raise_if_bad_sheet_by_index (self , index : int ) -> None :
@@ -716,20 +690,9 @@ def parse(
716690 decimal : str = "." ,
717691 comment : str | None = None ,
718692 skipfooter : int = 0 ,
719- convert_float : bool | None = None ,
720- mangle_dupe_cols : bool = True ,
721693 ** kwds ,
722694 ):
723695
724- if convert_float is None :
725- convert_float = True
726- else :
727- warnings .warn (
728- "convert_float is deprecated and will be removed in a future version." ,
729- FutureWarning ,
730- stacklevel = find_stack_level (),
731- )
732-
733696 validate_header_arg (header )
734697 validate_integer ("nrows" , nrows )
735698
@@ -763,7 +726,7 @@ def parse(
763726 sheet = self .get_sheet_by_index (asheetname )
764727
765728 file_rows_needed = self ._calc_rows (header , index_col , skiprows , nrows )
766- data = self .get_sheet_data (sheet , convert_float , file_rows_needed )
729+ data = self .get_sheet_data (sheet , file_rows_needed )
767730 if hasattr (sheet , "close" ):
768731 # pyxlsb opens two TemporaryFiles
769732 sheet .close ()
@@ -885,7 +848,6 @@ def parse(
885848 comment = comment ,
886849 skipfooter = skipfooter ,
887850 usecols = usecols ,
888- mangle_dupe_cols = mangle_dupe_cols ,
889851 ** kwds ,
890852 )
891853
@@ -1718,8 +1680,6 @@ def parse(
17181680 thousands : str | None = None ,
17191681 comment : str | None = None ,
17201682 skipfooter : int = 0 ,
1721- convert_float : bool | None = None ,
1722- mangle_dupe_cols : bool = True ,
17231683 ** kwds ,
17241684 ) -> DataFrame | dict [str , DataFrame ] | dict [int , DataFrame ]:
17251685 """
@@ -1751,8 +1711,6 @@ def parse(
17511711 thousands = thousands ,
17521712 comment = comment ,
17531713 skipfooter = skipfooter ,
1754- convert_float = convert_float ,
1755- mangle_dupe_cols = mangle_dupe_cols ,
17561714 ** kwds ,
17571715 )
17581716
0 commit comments