Skip to content

Commit 7916e76

Browse files
author
y-p
committed
BUG: check and raise on df.applymap with df having dupe columns
1 parent 9ec54ca commit 7916e76

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: pandas/core/frame.py

+3
Original file line numberDiff line numberDiff line change
@@ -4244,6 +4244,9 @@ def infer(x):
42444244
if com.is_datetime64_dtype(x):
42454245
x = lib.map_infer(x, lib.Timestamp)
42464246
return lib.map_infer(x, func)
4247+
#GH2786
4248+
if not self.columns.is_unique:
4249+
raise ValueError("applymap does not support dataframes having duplicate column labels")
42474250
return self.apply(infer)
42484251

42494252
#----------------------------------------------------------------------

0 commit comments

Comments
 (0)