4141 AbstractMethodError ,
4242 ParserWarning ,
4343)
44- from pandas .util ._decorators import (
45- Appender ,
46- deprecate_kwarg ,
47- )
44+ from pandas .util ._decorators import Appender
4845from pandas .util ._exceptions import find_stack_level
4946
5047from pandas .core .dtypes .common import (
152149 example of a valid callable argument would be ``lambda x: x.upper() in
153150 ['AAA', 'BBB', 'DDD']``. Using this parameter results in much faster
154151 parsing time and lower memory usage.
155- mangle_dupe_cols : bool, default True
156- Duplicate columns will be specified as 'X', 'X.1', ...'X.N', rather than
157- 'X'...'X'. Passing in False will cause data to be overwritten if there
158- are duplicate names in the columns.
159-
160- .. deprecated:: 1.5.0
161- Not implemented, and a new argument to specify the pattern for the
162- names of duplicated columns will be added instead
163152dtype : Type name or dict of column -> type, optional
164153 Data type for data or columns. E.g. {{'a': np.float64, 'b': np.int32,
165154 'c': 'Int64'}}
@@ -604,7 +593,6 @@ def read_csv(
604593 names : Sequence [Hashable ] | None | lib .NoDefault = ...,
605594 index_col : IndexLabel | Literal [False ] | None = ...,
606595 usecols = ...,
607- mangle_dupe_cols : bool = ...,
608596 dtype : DtypeArg | None = ...,
609597 engine : CSVEngine | None = ...,
610598 converters = ...,
@@ -661,7 +649,6 @@ def read_csv(
661649 names : Sequence [Hashable ] | None | lib .NoDefault = ...,
662650 index_col : IndexLabel | Literal [False ] | None = ...,
663651 usecols = ...,
664- mangle_dupe_cols : bool = ...,
665652 dtype : DtypeArg | None = ...,
666653 engine : CSVEngine | None = ...,
667654 converters = ...,
@@ -718,7 +705,6 @@ def read_csv(
718705 names : Sequence [Hashable ] | None | lib .NoDefault = ...,
719706 index_col : IndexLabel | Literal [False ] | None = ...,
720707 usecols = ...,
721- mangle_dupe_cols : bool = ...,
722708 dtype : DtypeArg | None = ...,
723709 engine : CSVEngine | None = ...,
724710 converters = ...,
@@ -775,7 +761,6 @@ def read_csv(
775761 names : Sequence [Hashable ] | None | lib .NoDefault = ...,
776762 index_col : IndexLabel | Literal [False ] | None = ...,
777763 usecols = ...,
778- mangle_dupe_cols : bool = ...,
779764 dtype : DtypeArg | None = ...,
780765 engine : CSVEngine | None = ...,
781766 converters = ...,
@@ -821,7 +806,6 @@ def read_csv(
821806 ...
822807
823808
824- @deprecate_kwarg (old_arg_name = "mangle_dupe_cols" , new_arg_name = None )
825809@Appender (
826810 _doc_read_csv_and_table .format (
827811 func_name = "read_csv" ,
@@ -842,7 +826,6 @@ def read_csv(
842826 names : Sequence [Hashable ] | None | lib .NoDefault = lib .no_default ,
843827 index_col : IndexLabel | Literal [False ] | None = None ,
844828 usecols = None ,
845- mangle_dupe_cols : bool = True ,
846829 # General Parsing Configuration
847830 dtype : DtypeArg | None = None ,
848831 engine : CSVEngine | None = None ,
@@ -923,7 +906,6 @@ def read_table(
923906 names : Sequence [Hashable ] | None | lib .NoDefault = ...,
924907 index_col : IndexLabel | Literal [False ] | None = ...,
925908 usecols = ...,
926- mangle_dupe_cols : bool = ...,
927909 dtype : DtypeArg | None = ...,
928910 engine : CSVEngine | None = ...,
929911 converters = ...,
@@ -980,7 +962,6 @@ def read_table(
980962 names : Sequence [Hashable ] | None | lib .NoDefault = ...,
981963 index_col : IndexLabel | Literal [False ] | None = ...,
982964 usecols = ...,
983- mangle_dupe_cols : bool = ...,
984965 dtype : DtypeArg | None = ...,
985966 engine : CSVEngine | None = ...,
986967 converters = ...,
@@ -1037,7 +1018,6 @@ def read_table(
10371018 names : Sequence [Hashable ] | None | lib .NoDefault = ...,
10381019 index_col : IndexLabel | Literal [False ] | None = ...,
10391020 usecols = ...,
1040- mangle_dupe_cols : bool = ...,
10411021 dtype : DtypeArg | None = ...,
10421022 engine : CSVEngine | None = ...,
10431023 converters = ...,
@@ -1094,7 +1074,6 @@ def read_table(
10941074 names : Sequence [Hashable ] | None | lib .NoDefault = ...,
10951075 index_col : IndexLabel | Literal [False ] | None = ...,
10961076 usecols = ...,
1097- mangle_dupe_cols : bool = ...,
10981077 dtype : DtypeArg | None = ...,
10991078 engine : CSVEngine | None = ...,
11001079 converters = ...,
@@ -1140,7 +1119,6 @@ def read_table(
11401119 ...
11411120
11421121
1143- @deprecate_kwarg (old_arg_name = "mangle_dupe_cols" , new_arg_name = None )
11441122@Appender (
11451123 _doc_read_csv_and_table .format (
11461124 func_name = "read_table" ,
@@ -1161,7 +1139,6 @@ def read_table(
11611139 names : Sequence [Hashable ] | None | lib .NoDefault = lib .no_default ,
11621140 index_col : IndexLabel | Literal [False ] | None = None ,
11631141 usecols = None ,
1164- mangle_dupe_cols : bool = True ,
11651142 # General Parsing Configuration
11661143 dtype : DtypeArg | None = None ,
11671144 engine : CSVEngine | None = None ,
@@ -1406,9 +1383,6 @@ def _get_options_with_defaults(self, engine: CSVEngine) -> dict[str, Any]:
14061383 f"The { repr (argname )} option is not supported with the "
14071384 f"'pyarrow' engine"
14081385 )
1409- if argname == "mangle_dupe_cols" and value is False :
1410- # GH12935
1411- raise ValueError ("Setting mangle_dupe_cols=False is not supported yet" )
14121386 options [argname ] = value
14131387
14141388 for argname , default in _c_parser_defaults .items ():
0 commit comments