41
41
AbstractMethodError ,
42
42
ParserWarning ,
43
43
)
44
- from pandas .util ._decorators import (
45
- Appender ,
46
- deprecate_kwarg ,
47
- )
44
+ from pandas .util ._decorators import Appender
48
45
from pandas .util ._exceptions import find_stack_level
49
46
50
47
from pandas .core .dtypes .common import (
152
149
example of a valid callable argument would be ``lambda x: x.upper() in
153
150
['AAA', 'BBB', 'DDD']``. Using this parameter results in much faster
154
151
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
163
152
dtype : Type name or dict of column -> type, optional
164
153
Data type for data or columns. E.g. {{'a': np.float64, 'b': np.int32,
165
154
'c': 'Int64'}}
@@ -604,7 +593,6 @@ def read_csv(
604
593
names : Sequence [Hashable ] | None | lib .NoDefault = ...,
605
594
index_col : IndexLabel | Literal [False ] | None = ...,
606
595
usecols = ...,
607
- mangle_dupe_cols : bool = ...,
608
596
dtype : DtypeArg | None = ...,
609
597
engine : CSVEngine | None = ...,
610
598
converters = ...,
@@ -661,7 +649,6 @@ def read_csv(
661
649
names : Sequence [Hashable ] | None | lib .NoDefault = ...,
662
650
index_col : IndexLabel | Literal [False ] | None = ...,
663
651
usecols = ...,
664
- mangle_dupe_cols : bool = ...,
665
652
dtype : DtypeArg | None = ...,
666
653
engine : CSVEngine | None = ...,
667
654
converters = ...,
@@ -718,7 +705,6 @@ def read_csv(
718
705
names : Sequence [Hashable ] | None | lib .NoDefault = ...,
719
706
index_col : IndexLabel | Literal [False ] | None = ...,
720
707
usecols = ...,
721
- mangle_dupe_cols : bool = ...,
722
708
dtype : DtypeArg | None = ...,
723
709
engine : CSVEngine | None = ...,
724
710
converters = ...,
@@ -775,7 +761,6 @@ def read_csv(
775
761
names : Sequence [Hashable ] | None | lib .NoDefault = ...,
776
762
index_col : IndexLabel | Literal [False ] | None = ...,
777
763
usecols = ...,
778
- mangle_dupe_cols : bool = ...,
779
764
dtype : DtypeArg | None = ...,
780
765
engine : CSVEngine | None = ...,
781
766
converters = ...,
@@ -821,7 +806,6 @@ def read_csv(
821
806
...
822
807
823
808
824
- @deprecate_kwarg (old_arg_name = "mangle_dupe_cols" , new_arg_name = None )
825
809
@Appender (
826
810
_doc_read_csv_and_table .format (
827
811
func_name = "read_csv" ,
@@ -842,7 +826,6 @@ def read_csv(
842
826
names : Sequence [Hashable ] | None | lib .NoDefault = lib .no_default ,
843
827
index_col : IndexLabel | Literal [False ] | None = None ,
844
828
usecols = None ,
845
- mangle_dupe_cols : bool = True ,
846
829
# General Parsing Configuration
847
830
dtype : DtypeArg | None = None ,
848
831
engine : CSVEngine | None = None ,
@@ -923,7 +906,6 @@ def read_table(
923
906
names : Sequence [Hashable ] | None | lib .NoDefault = ...,
924
907
index_col : IndexLabel | Literal [False ] | None = ...,
925
908
usecols = ...,
926
- mangle_dupe_cols : bool = ...,
927
909
dtype : DtypeArg | None = ...,
928
910
engine : CSVEngine | None = ...,
929
911
converters = ...,
@@ -980,7 +962,6 @@ def read_table(
980
962
names : Sequence [Hashable ] | None | lib .NoDefault = ...,
981
963
index_col : IndexLabel | Literal [False ] | None = ...,
982
964
usecols = ...,
983
- mangle_dupe_cols : bool = ...,
984
965
dtype : DtypeArg | None = ...,
985
966
engine : CSVEngine | None = ...,
986
967
converters = ...,
@@ -1037,7 +1018,6 @@ def read_table(
1037
1018
names : Sequence [Hashable ] | None | lib .NoDefault = ...,
1038
1019
index_col : IndexLabel | Literal [False ] | None = ...,
1039
1020
usecols = ...,
1040
- mangle_dupe_cols : bool = ...,
1041
1021
dtype : DtypeArg | None = ...,
1042
1022
engine : CSVEngine | None = ...,
1043
1023
converters = ...,
@@ -1094,7 +1074,6 @@ def read_table(
1094
1074
names : Sequence [Hashable ] | None | lib .NoDefault = ...,
1095
1075
index_col : IndexLabel | Literal [False ] | None = ...,
1096
1076
usecols = ...,
1097
- mangle_dupe_cols : bool = ...,
1098
1077
dtype : DtypeArg | None = ...,
1099
1078
engine : CSVEngine | None = ...,
1100
1079
converters = ...,
@@ -1140,7 +1119,6 @@ def read_table(
1140
1119
...
1141
1120
1142
1121
1143
- @deprecate_kwarg (old_arg_name = "mangle_dupe_cols" , new_arg_name = None )
1144
1122
@Appender (
1145
1123
_doc_read_csv_and_table .format (
1146
1124
func_name = "read_table" ,
@@ -1161,7 +1139,6 @@ def read_table(
1161
1139
names : Sequence [Hashable ] | None | lib .NoDefault = lib .no_default ,
1162
1140
index_col : IndexLabel | Literal [False ] | None = None ,
1163
1141
usecols = None ,
1164
- mangle_dupe_cols : bool = True ,
1165
1142
# General Parsing Configuration
1166
1143
dtype : DtypeArg | None = None ,
1167
1144
engine : CSVEngine | None = None ,
@@ -1406,9 +1383,6 @@ def _get_options_with_defaults(self, engine: CSVEngine) -> dict[str, Any]:
1406
1383
f"The { repr (argname )} option is not supported with the "
1407
1384
f"'pyarrow' engine"
1408
1385
)
1409
- if argname == "mangle_dupe_cols" and value is False :
1410
- # GH12935
1411
- raise ValueError ("Setting mangle_dupe_cols=False is not supported yet" )
1412
1386
options [argname ] = value
1413
1387
1414
1388
for argname , default in _c_parser_defaults .items ():
0 commit comments