Skip to content

Commit eb226bd

Browse files
authored
DOC: Add mention that mangle_dupe_cols is deprecated in user guide (#48182)
1 parent 34524ee commit eb226bd

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

doc/source/user_guide/io.rst

+9-21
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ mangle_dupe_cols : boolean, default ``True``
179179
Passing in ``False`` will cause data to be overwritten if there are duplicate
180180
names in the columns.
181181

182+
.. deprecated:: 1.5.0
183+
The argument was never implemented, and a new argument where the
184+
renaming pattern can be specified will be added instead.
185+
182186
General parsing configuration
183187
+++++++++++++++++++++++++++++
184188

@@ -611,6 +615,10 @@ If the header is in a row other than the first, pass the row number to
611615
Duplicate names parsing
612616
'''''''''''''''''''''''
613617

618+
.. deprecated:: 1.5.0
619+
``mangle_dupe_cols`` was never implemented, and a new argument where the
620+
renaming pattern can be specified will be added instead.
621+
614622
If the file or header contains duplicate names, pandas will by default
615623
distinguish between them so as to prevent overwriting data:
616624

@@ -621,27 +629,7 @@ distinguish between them so as to prevent overwriting data:
621629
622630
There is no more duplicate data because ``mangle_dupe_cols=True`` by default,
623631
which modifies a series of duplicate columns 'X', ..., 'X' to become
624-
'X', 'X.1', ..., 'X.N'. If ``mangle_dupe_cols=False``, duplicate data can
625-
arise:
626-
627-
.. code-block:: ipython
628-
629-
In [2]: data = 'a,b,a\n0,1,2\n3,4,5'
630-
In [3]: pd.read_csv(StringIO(data), mangle_dupe_cols=False)
631-
Out[3]:
632-
a b a
633-
0 2 1 2
634-
1 5 4 5
635-
636-
To prevent users from encountering this problem with duplicate data, a ``ValueError``
637-
exception is raised if ``mangle_dupe_cols != True``:
638-
639-
.. code-block:: ipython
640-
641-
In [2]: data = 'a,b,a\n0,1,2\n3,4,5'
642-
In [3]: pd.read_csv(StringIO(data), mangle_dupe_cols=False)
643-
...
644-
ValueError: Setting mangle_dupe_cols=False is not supported yet
632+
'X', 'X.1', ..., 'X.N'.
645633

646634
.. _io.usecols:
647635

0 commit comments

Comments
 (0)