title: pandas: cannot reindex from a duplicate axis
body: <p>I have this code:</p>
  
  <pre><code>missing_columns = list(set(model_header) - set(combined_data.columns))
  if missing_columns:
      combined_data = combined_data.reindex(columns=np.append(combined_data.columns.values, missing_columns))
  </code></pre>
  
  <p>which is sometimes generating this error</p>
  
  <blockquote>
    <p>cannot reindex from a duplicate axis</p>
  </blockquote>
  
  <p>I understand from other posts that this happens when you have a duplicate columns but I don't see how I can given I am adding the missing columns</p>
  
  <p>This is the traceback</p>
  
  <pre><code>Traceback:
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
    41.             response = get_response(request)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response
    249.             response = self._get_response(request)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
    187.                 response = self.process_exception_by_middleware(e, request)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
    185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
    552.                 return self.admin_site.admin_view(view)(*args, **kwargs)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
    149.                     response = view_func(request, *args, **kwargs)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
    57.         response = view_func(request, *args, **kwargs)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
    224.             return view(request, *args, **kwargs)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
    67.             return bound_func(*args, **kwargs)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
    149.                     response = view_func(request, *args, **kwargs)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
    63.                 return func.__get__(self, type(self))(*args2, **kwargs2)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in changelist_view
    1590.                 response = self.response_action(request, queryset=cl.get_queryset(request))
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in response_action
    1287.             response = func(self, request, queryset)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/webcdi/researcher_UI/admin_actions.py" in scoring_data
    20.     return download_data(request, study_obj, administrations)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
    23.                 return view_func(request, *args, **kwargs)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/webcdi/researcher_UI/views.py" in download_data
    145.         combined_data = combined_data.reindex(columns=np.append(combined_data.columns.values, missing_columns))
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/pandas/core/frame.py" in reindex
    2733.                                               **kwargs)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/pandas/core/generic.py" in reindex
    2515.                                   fill_value, copy).__finalize__(self)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/pandas/core/frame.py" in _reindex_axes
    2674.                                            fill_value, limit, tolerance)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/pandas/core/frame.py" in _reindex_columns
    2699.                                            allow_dups=False)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/pandas/core/generic.py" in _reindex_with_indexers
    2627.                                                 copy=copy)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/pandas/core/internals.py" in reindex_indexer
    3886.             self.axes[axis]._can_reindex(indexer)
  
  File "/home/henry/Documents/Sites/Development/web-cdi/env/local/lib/python2.7/site-packages/pandas/core/indexes/base.py" in _can_reindex
    2836.             raise ValueError("cannot reindex from a duplicate axis")
  
  Exception Type: ValueError at /wcadmin/researcher_UI/study/
  Exception Value: cannot reindex from a duplicate axis
  </code></pre>
  
  <p>I've looked at the columns and I don't see an overlap.  Could this be anything else?</p>