diff --git a/pandas/core/frame.py b/pandas/core/frame.py index e4e9705e562d0..05d3713375481 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -837,6 +837,10 @@ def to_dict(self, outtype='dict'): ------- result : dict like {column -> {index -> value}} """ + import warnings + if not self.columns.is_unique: + warnings.warn("DataFrame columns are not unique, some " + "columns will be omitted.",UserWarning) if outtype.lower().startswith('d'): return dict((k, v.to_dict()) for k, v in self.iteritems()) elif outtype.lower().startswith('l'):