wesm/pandas — Issue #708: concat DataFrames bug with keys on axis=1
Author: wesm
Created: 2012-01-28 20:49:43+00:00
State: open
Labels: Bug, prio-high

```

In [11]: t1
Out[11]:
value
id
a 1
b 2
c 3

In [12]: t2
Out[12]:
value
id
a 7
b 8

In [13]: concat([t1, t2], axis=1, keys=['t1', 't2'])
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
/home/wesm/Dropbox/book/svn/ in ()
----> 1 concat([t1, t2], axis=1, keys=['t1', 't2'])

/home/wesm/code/pandas/pandas/tools/merge.pyc in concat(objs, axis, join, join_axes, ignore_index, keys, levels, names, verify_integrity)
649 keys=keys, levels=levels, names=names,
650 verify_integrity=verify_integrity)
--> 651 return op.get_result()
652
653

/home/wesm/code/pandas/pandas/tools/merge.pyc in get_result(self)
715 return Series(new_data, index=self.new_axes[0], name=name)
716 else:
--> 717 new_data = self._get_concatenated_data()
718 return self.objs[0]._from_axes(new_data, self.new_axes)
719

/home/wesm/code/pandas/pandas/tools/merge.pyc in _get_concatenated_data(self)
735 stacked_block = self._concat_blocks(klass_blocks)
736 new_blocks.append(stacked_block)
--> 737 new_data = BlockManager(new_blocks, self.new_axes)
738 except Exception: # EAFP
739 # should not be possible to fail here for the expected reason with

/home/wesm/code/pandas/pandas/core/internals.pyc in __init__(self, blocks, axes, do_integrity_check)
283
284 if do_integrity_check:
--> 285 self._verify_integrity()
286
287 def __nonzero__(self):

/home/wesm/code/pandas/pandas/core/internals.pyc in _verify_integrity(self)
362
363 def _verify_integrity(self):
--> 364 _union_block_items(self.blocks)
365 mgr_shape = self.shape
366 for block in self.blocks:

/home/wesm/code/pandas/pandas/core/internals.pyc in _union_block_items(blocks)
1071
1072 if tot_len > len(the_union):
-> 1073 raise Exception('item names overlap')
1074 return the_union
1075

Exception: item names overlap
```